-
Jul 23rd, 2011, 07:02 AM
#21
Hi I am getting below error when i started application in tomcat.
12:54:55,978 [ERROR] [main] [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'mattSnapshotRepository': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.transaction.interceptor.Transa ctionInterceptor.setTransactionManagerBeanName(Lja va/lang/String
V
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 91)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:288 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:580)
at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:895)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:425)
at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 47)
at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:4205)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4704)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:840)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:463)
at org.apache.catalina.core.StandardService.start(Sta ndardService.java:525)
at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalin a.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:414)
Caused by: java.lang.NoSuchMethodError: org.springframework.transaction.interceptor.Transa ctionInterceptor.setTransactionManagerBeanName(Lja va/lang/String
V
at org.springframework.data.repository.core.support.T ransactionalRepositoryProxyPostProcessor.<init>(Tr ansactionalRepositoryProxyPostProcessor.java:76)
at org.springframework.data.repository.core.support.T ransactionalRepositoryFactoryBeanSupport.setBeanFa ctory(TransactionalRepositoryFactoryBeanSupport.ja va:98)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeAwareMethods(Abst ractAutowireCapableBeanFactory.java:1439)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1408)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519)
... 26 more
23-Jul-2011 12:54:55 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner
MY appcontext.xml 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
="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schem...-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schem...ng-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schem...ng-mvc-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schem...ng-aop-3.0.xsd
http://www.springframework.org/schema/data/jpa
http://www.springframework.org/schem...spring-jpa.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionM anager"
p:entityManagerFactory-ref="entityManagerFactory" />
<bean id="assuranceRepositoryDataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName"
value="${assurance.repository.datasource.drivercla ssname}" />
<property name="url" value="${assurance.repository.datasource.url}" />
<property name="username" value="${assurance.repository.datasource.username} " />
<property name="password" value="${assurance.repository.datasource.password} " />
</bean>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerE ntityManagerFactoryBean"
p:dataSource-ref="assuranceRepositoryDataSource"
p
ersistenceUnitName="assuranceRepository-jpa">
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.Hibernat eJpaVendorAdapter" />
</property>
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
<jpa:repositories base-package="com.assurance.repository" entity-manager-factory-ref="entityManagerFactory">
</jpa:repositories>
</beans>
please help me ....
-
Jul 23rd, 2011, 07:10 AM
#22
Apparently you're using a Spring version < 3.0.5. Update to that version and you should be fine.
-
Jul 23rd, 2011, 07:32 AM
#23
Many Thanks for your reply,
I am using org.springframework.version 3.0.5.RELEASE. "Update to that version and you should be fine." i do not get this ... Please send me in details. Your help is highly appreciated...
In fact if I am using Junt to pint the applicationContext.xml file it is working fine..
When I am starting the Tomcat server i am getting this problem.
Last edited by siva_chimpiri@yahoo.co.in; Jul 23rd, 2011 at 07:44 AM.
-
Jul 23rd, 2011, 08:16 AM
#24
The exception you posted states it can't find the method setTransactionManagerBeanName which was introduced in Spring 3.0.0.RC1. So if you really have 3.0.5 on your classpath you apparently also have some JARs of versions prior to 3.0.0.RC1 (a 2.5.6 maybe?) on the classpath.
As a side note, would you please stop spamming all available channels with copies of the question? Thanks a lot.
-
Jul 24th, 2011, 04:47 AM
#25
Dear Oliver Gierke,
My apologies for posting in multiple channels,
many thanks for your reply.
I was able identified the problem in my application,
In real I created 1 WEB-APP which is using 2 jar apps. the 1jar app is Spring Data, JPA, and Hibernate the 2Jar-app is using Ibats framework.
now my application is looks like below:
WEB-APP
----------------->SpringDataApp
--------------------------->ibats App (Spring data app also using the IbatsApp)
----------------->ibats App
Once I consolidated all the configurations in to my web-app applicationContext.xml I am getting the above error. I believe this is because "transactionManager" bean is common for both applications. but when the web-application is loaded the SpringDataApp and ibatisApp using the common "transactionManager".
Here are the scenarios I tested:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
WEB-APP | SPRING DATA APP | IBATS APP | INTEGRATION RERSULT WITH TOMCAT | JUNIT with @ContextConfiguration
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
.... X.....................X........................... ..........................WORKING................. ..............................WORKING
.... X................................................. ......X ..................WORKING......................... ......................WORKING
.... X.....................X........................... .....X ...................NOT WORKING.......................................WORK ING
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Please help me How can I get rid of this problem??
( nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'mattSnapshotRepository': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.transaction.interceptor.Transa ctionInterceptor.setTransactionManagerBeanName(Lja va/lang/String
V )
Your Help is highly appreciated,
Siva
Last edited by siva_chimpiri@yahoo.co.in; Jul 24th, 2011 at 04:54 AM.
-
Jul 24th, 2011, 11:14 AM
#26
I hate to repeat myself but I can't help to say it again: you have a spring-transaction or org.springframework.transaction JAR in you classpath that is of version < 3.0.0.RC1. In JARs of this older version TransactionAspectSupport is lacking the method setTransactionManagerBean name (which was introduce in 3.0.0.RC1 as you can see from our fisheye instance). So would you please check your classpath for JARs of that specification. Removing it from the classpath will resolve this problem.
-
Jul 25th, 2011, 06:36 AM
#27
Dear Oliver,
Many thnkas for your reply, I jut drilled down in to the problem.
I am glad to say that I got a break through on this error.. In fact the reason is I am using Ibats application i am using spring-ibatis version 2.0.8, when i added this in to my pom.xml file it will automatically adding the dependecy for spring-dao-2.0.8.jar version and the TransactionAspectSupport is not having the proper methods. I just exclude the spring-dao-2.0.8.jar from spring-ibatis dependency. Now I got the spring-TX3.05Release version and it is working fine.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-ibatis</artifactId>
<version>2.0.8</version>
<type>jar</type>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-dao</artifactId>
</exclusion>
</exclusions>
</dependency>
Once again many Thanks for your help.
-
Aug 4th, 2011, 01:54 AM
#28
I have a problem with spring-data-jpa with Virgo server.
Virgo server told me, cannot resolve javax.annotation;version="[1.3.0, 2.0.0)".
I search javax.annotation bundle package, but i cannot meet it.
Can you help me please?
Thank you.
-
Oct 27th, 2011, 12:34 PM
#29
-
Nov 7th, 2011, 04:46 PM
#30
Hi Oliver,
Congratulations for your work!
I'm very interested in spring-data-jpa and I'm trying to find more information about the project. I've found a webinar but the resolution is very low. Could you tell me if there is another url to this webinar with a higher resolution?
http://www.youtube.com/watch?v=Yg2gCpBCkZw
Thanks in advance!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules