0

Hi I am using Hibernate 4 and recently upgraded to spring 4 .I get this error in my hibernate.xml below

java.lang.NoSuchMethodError: org.springframework.aop.config.AopNamespaceUtils.registerAutoProxyCreatorIfNecessary

    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
    <tx:annotation-driven />
    <!-- Hibernate session factory -->
    <bean id="sessionFactory"
        class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
        <property name="dataSource">
            <ref bean="dataSource" />
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">${hibernate.dialect}</prop>
                <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
                <prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop>
                <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
                <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
                <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}
                </prop>
                <prop key="net.sf.ehcache.configurationResourceName">${net.sf.ehcache.configurationResourceName}</prop>
                <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
                <prop key="hibernate.cache.use_structured_entries">${hibernate.cache.use_structured_entries}</prop>
                <prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop>
                <prop key="hibernate.order_inserts">${hibernate.order_inserts}</prop>
                <prop key="hibernate.order_updates">${hibernate.order_updates}</prop>
            </props>
        </property>
        <property name="packagesToScan" value="com.pumpkinsafari.store.model">
        </property>
    </bean>
    <bean id="transactionManager"
        class="org.springframework.orm.hibernate4.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory" />
    </bean>

</beans>    

Please Help me regarding the same seems to be a SPRING 4 aop deprecation issue .But is there any way to overcome this .I am also using hibernate jpa api jars

Gaurav Rawat
  • 1,294
  • 1
  • 25
  • 52
  • 1
    If you get these kind of errors you are probably mixing spring versions. Check your actual classpath for which dependencies you are using. When using maven use `mvn dependency:tree` to get a list of your dependencies. – M. Deinum Mar 20 '14 at 07:03
  • Yup the actual error was cause the class files of spring dao were now included in spring tx 4 release and hence conflicting .THe classloader used to pick the latter .but yes mvn dependecy:tree does help – Gaurav Rawat Mar 20 '14 at 09:22
  • you can find the anwser here : http://stackoverflow.com/a/20981458/3343174 – Fakher Mar 17 '15 at 10:00

1 Answers1

0

Hi i think the issues was cause of my 2.0.8 dependency which I had used in my prior release seems now that is included in spring tx module..

Regards

Gaurav Rawat
  • 1,294
  • 1
  • 25
  • 52