0

I'm receiving the cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tx:annotation-driven'. error at the <tx:annotation-driven transaction-manager="myTransactionManager" /> line on my xml configuration file:

<?xml version="1.0" encoding="UTF-8"?>

<beans  xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="http://www.springframework.org/schema/context"           
        xmlns:mvc="http://www.springframework.org/schema/mvc"
        xmlns:tx="http://springframework.org/schema/tx"  
        xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
        http://www.springframework.org/schema/mvc 
        http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
        http://www.springframework.org/schema/tx 
        http://www.springframework.org/schema/tx/spring-tx.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-3.2.xsd">

        <!--Dispatcher controller-->
        <context:component-scan base-package="com.ps.springmvc.psbankapp"></context:component-scan>

        <mvc:annotation-driven></mvc:annotation-driven>

        <bean   id="viewResolver"
                class="org.springframework.web.servlet.view.InternalResourceViewResolver">
                <property name="prefix" value="/WEB-INF/views/"/>
                <property name="suffix" value=".jsp"/>
        </bean>
        <!--Dispatcher controller-->

        <!--Uniform labels. Tambien scannea para usar las clases añadidas .jar de Hibernate-->
        <bean id="messageSource"
        class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
            <property name="basenames">
                <list>
                    <value>
                        WEB-INF/account
                    </value>
                </list>
            </property>
            <property name="defaultEncoding" value="UTF-8"/>
        </bean>
        <!--Uniform labels-->

        <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
            destroy-method="close">
            <property name="driverClass" value="com.mysql.jdbc.Driver"/>
            <property name="jdbcUrl" 
                value="jdbc:mysql://localhost:3306/psbankdb?useSSL=false" />
            <property name="user" value="root" />
            <property name="password" value="root" />
        </bean>

        <bean id="sessionFactory" 
            class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
            <property name="datasource" ref="datasource"/>
            <property name="packagesToScan" value="com.ps.springmvc.psbankapp" />
            <property name="hibernateProperties">
                <props> 
                    <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
                    <prop key="hibernate.show_sql">true</prop>
                </props>
            </property>
        </bean>

        <bean id="myTransactionManager" 
            class="org.springframework.orm.hibernate5.HibernateTransactionManager">
            <property name="sessionFactory" ref="sessionFactory" />
        </bean>

        <tx:annotation-driven transaction-manager="myTransactionManager" />

</beans>

Mike
  • 1
  • 1
  • 2
  • 1
    Check this out: https://stackoverflow.com/questions/6058037/the-matching-wildcard-is-strict-but-no-declaration-can-be-found-for-element-tx – Tom Mar 26 '19 at 00:00
  • Possible duplicate of [The matching wildcard is strict, but no declaration can be found for element 'tx:annotation-driven'](https://stackoverflow.com/questions/6058037/the-matching-wildcard-is-strict-but-no-declaration-can-be-found-for-element-tx) – Tom Mar 26 '19 at 00:01
  • I wasn't able to fix my error with the answers to those questions. – Mike Mar 29 '19 at 23:45

0 Answers0