Announcement Announcement Module
Collapse
No announcement yet.
<tx:annotation-driven> causing exception parsing spring context XML after upgrading Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • <tx:annotation-driven> causing exception parsing spring context XML after upgrading

    I have an instance of Eclipse just upgraded from SpringIDE2.2.6
    to 2.3.0.

    With the same project, an exception was thrown by plugin
    org.springframework.ide.eclipse.beans.core
    with the new version of SpringIDE

    The stack trace:

    org.springframework.beans.factory.BeanDefinitionSt oreException: Unexpected exception parsing XML document from file [C:/baker/workspace/springweb/WebContent/WEB-INF/applicationContext.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.MutablePropertyValues.ad d(Ljava/lang/String;Ljava/lang/ObjectLorg/springframework/beans/MutablePropertyValues;
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:394)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:316)
    at org.springframework.ide.eclipse.beans.core.interna l.model.BeansConfig$2.loadBeanDefinitions(BeansCon fig.java:338)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:284)
    at org.springframework.ide.eclipse.beans.core.interna l.model.BeansConfig$3.call(BeansConfig.java:380)
    at org.springframework.ide.eclipse.beans.core.interna l.model.BeansConfig$3.call(BeansConfig.java:1)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unkn own Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.Executors$RunnableAdapter.cal l(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unkn own Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NoSuchMethodError: org.springframework.beans.MutablePropertyValues.ad d(Ljava/lang/String;Ljava/lang/ObjectLorg/springframework/beans/MutablePropertyValues;
    at org.springframework.transaction.config.AnnotationD rivenBeanDefinitionParser.registerTransactionManag er(AnnotationDrivenBeanDefinitionParser.java:95)
    at org.springframework.transaction.config.AnnotationD rivenBeanDefinitionParser.access$0(AnnotationDrive nBeanDefinitionParser.java:94)
    at org.springframework.transaction.config.AnnotationD rivenBeanDefinitionParser$AopAutoProxyConfigurer.c onfigureAutoProxyCreator(AnnotationDrivenBeanDefin itionParser.java:121)
    at org.springframework.transaction.config.AnnotationD rivenBeanDefinitionParser.parse(AnnotationDrivenBe anDefinitionParser.java:79)
    at org.springframework.beans.factory.xml.NamespaceHan dlerSupport.parse(NamespaceHandlerSupport.java:72)
    at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1327)
    at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1317)
    at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.parseBeanDefinitions(Defau ltBeanDefinitionDocumentReader.java:135)
    at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.registerBeanDefinitions(De faultBeanDefinitionDocumentReader.java:92)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:475)
    at org.springframework.ide.eclipse.beans.core.interna l.model.BeansConfig$2.registerBeanDefinitions(Bean sConfig.java:351)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:372)
    ... 13 more


    The root cause of the exception is:
    Caused by: java.lang.NoSuchMethodError: org.springframework.beans.MutablePropertyValues.ad d(Ljava/lang/String;Ljava/lang/ObjectLorg/springframework/beans/MutablePropertyValues;

    My project is using Spring2.5.6 library and I noticed that
    this method, MutablePropertyValues.add(), is indeed not existing.
    Is SpringIDE use the spring runtime configured on my porject
    here to parse the context XML? If so, why does it invoke
    method which is only available in 3.0?

    Also from the stack trace, the problem seems related to tag:
    <tx:annotation-driven>
    I can confirm the problem foes away if I comment it out.

    -----------------------------------------------------------------------
    <?xml version="1.0" encoding="UTF-8" standalone="no"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
    <!--bean post-processor for JPA annotations-->
    <bean class="org.springframework.orm.jpa.support.Persist enceAnnotationBeanPostProcessor">
    </bean>

    <!--Exception translation bean post processor-->
    <bean class="org.springframework.dao.annotation.Persiste nceExceptionTranslationPostProcessor">
    </bean>

    <!--Transaction manager for a single JPA EntityManager (alternative to JTA)-->
    <bean class="org.springframework.orm.jpa.LocalEntityMana gerFactoryBean" id="entityManagerFactory">
    <property name="persistenceUnitName" value="springweb"/>
    </bean>
    <bean class="org.springframework.orm.jpa.JpaTransactionM anager" id="transactionManager">
    <property name="entityManagerFactory" ref="entityManagerFactory"/>
    </bean>

    <!-- enable the configuration of transactional behavior based on annotations -->
    <tx:annotation-driven transaction-manager="transactionManager"/>

    <bean class="jpa.OrmSvcSpringService" id="OrmSvcService">
    <property name="dao">
    <bean class="jpa.OrmSvcJPADao"/>
    </property>
    </bean>
    </beans>
Working...
X