Announcement Announcement Module
Collapse
No announcement yet.
java.lang.NoSuchMethodError: org.springframework.aop.config.AopNamespaceUtils.r egist Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • java.lang.NoSuchMethodError: org.springframework.aop.config.AopNamespaceUtils.r egist

    Hi,

    Here is my dilemma, on our development server we developed, deployed and tested our application. Now built the exact same server, with the following setup:

    Tomcat: 6.0.18
    Ubuntu: 8.04
    Java: build 1.6.0_06-b02

    When I do the deploy to the production by merely switching the maven's pom.xml to point to the production servers tomcat I end up getting this error in the logs:

    Code:
    Oct 17, 2008 4:49:55 PM org.apache.catalina.core.StandardContext listenerStart
    
    SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    
    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [jar:file:/data/www/tomcat/lib/commons-0.0.2.jar!/applicationContext-hibernate.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.config.AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(Lorg/springframework/beans/factory/xml/ParserContext;Ljava/lang/Object;)V
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:385)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:313)
            at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:290)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)
            at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:158)
            at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
    	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:97)
    	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:411)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:338)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:251)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
    	at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
    	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
    	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
    	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
            at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Caused by: java.lang.NoSuchMethodError: org.springframework.aop.config.AopNamespaceUtils.registerAutoProxyCreatorIfNecessary(Lorg/springframework/beans/factory/xml/ParserContext;Ljava/lang/Object;)V
    	at org.springframework.transaction.config.AnnotationDrivenBeanDefinitionParser.parseInternal(AnnotationDrivenBeanDefinitionParser.java:54)
    	at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:56)
    	at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1246)
    	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1236)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:468)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:363)
    	... 36 more
    I had also copied all the jar's from the development tomcat/lib into the production cause our pom.xml has <scope>provided</scope> for each of the dependencies.

    The tomcat lib looks like the following:

    Code:
    acegi-security-1.0.5.jar
    acegi-security-tiger-1.0.5.jar
    annotations-api.jar
    antlr-2.7.6.jar
    aopalliance-1.0.jar
    asm-1.5.3.jar
    asm-attrs-1.5.3.jar
    aspectjrt-1.5.3.jar
    aspectjweaver-1.5.3.jar
    casclient-2.1.1.jar
    catalina-ant.jar
    catalina-ha.jar
    catalina-tribes.jar
    catalina.jar
    cglib-2.1_3.jar
    commons-codec-1.3.jar
    commons-collections-3.2.jar
    commons-dbcp-1.2.jar
    commons-lang-2.1.jar
    commons-logging-1.1.jar
    commons-pool-1.2.jar
    concurrent-1.3.4.jar
    dom4j-1.6.1.jar
    ehcache-1.3.0.jar
    el-api.jar
    hibernate-3.2.5.ga.jar
    hibernate-annotations-3.2.1.ga.jar
    hibernate-commons-annotations-3.0.0.ga.jar
    hibernate-entitymanager-3.2.1.ga.jar
    hibernate-validator-3.0.0.ga.jar
    itext-1.3.jar
    jasper-el.jar
    jasper-jdt.jar
    jasper.jar
    javassist-3.3.ga.jar
    jboss-archive-browsing-5.0.0alpha-200607201-119.jar
    jstl-1.1.2.jar
    jta-1.0.1B.jar
    jxl-2.6.3.jar
    libs.tar
    log4j-1.2.9.jar
    mysql-connector-java-5.1.5-bin.jar
    oro-2.0.8.jar
    persistence-api-1.0.jar
    poi-3.0.2-FINAL.jar
    servlet-api.jar
    spring-2.5.jar
    spring-aop-2.5.jar
    spring-beans-2.5.jar
    spring-context-2.5.jar
    spring-context-support-2.5.jar
    spring-core-2.5.jar
    spring-dao-2.0.7.jar
    spring-hibernate3-2.0.7.jar
    spring-jdbc-2.0.7.jar
    spring-jpa-2.0.7.jar
    spring-remoting-1.2.9.jar
    spring-support-1.2.9.jar
    spring-web-2.5.jar
    spring-webmvc-2.5.jar
    velocity-1.5.jar
    xercesImpl-2.8.1.jar
    xml-apis-1.0.b2.jar
    Here is the kicker: If I remove the libs and default it back to the original tomcat lib and take out the provided scope from the pom.xml aka have all the jar's packaged in with the WAR it works fine. Now if I move the exact same jar's into the tomcat/lib and restart the tomcat I get that error with the registerAutoProxy... bit.

    Any help would be MUCH appreciated. The commons-0.0.2.jar is a package that we have which is essentially some of our general functions we used in many of our code so to eliminate alot of redundant code it was just packaged into commons.

    Thank you so much for spending the time to read this.

    Also if needed the applicationContext-hibernate.xml starts as follows:

    Code:
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xmlns:context="http://www.springframework.org/schema/context"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
               http://www.springframework.org/schema/aop
               http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
               http://www.springframework.org/schema/tx
               http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
               http://www.springframework.org/schema/context
               http://www.springframework.org/schema/context/spring-context-2.5.xsd">
    
        <!-- Data Source Definitions -->
        <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
            <property name="jndiName" value="java:comp/env/jdbc/CentralDB"/>
        </bean>
    .....
    Cheers,
    Nathan.

  • #2
    Throw out all the 1.2.9 and 2.0.7 versions of Spring libraries.

    Actually, I think that spring-2.5.jar and spring-webmvc-2.5.jar should do.

    Comment


    • #3
      Hi dejanp,

      I tried doing that I read from other places that people are having problems with using maven and upgrading to spring 2.5. http://jira.springframework.org/browse/SPR-4161. This one showed that it has problems with spring-dao-2.0.7.jar. So I tried removing that from the lib then all the sudden got errors of the following:

      Code:
       Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.validator.ClassValidator.<init>(Ljava/lang/Class;Ljava/util/ResourceBundle;Lorg/hibernate/validator/MessageInterpolator;Ljava/util/Map;Lorg/hibernate/reflection/ReflectionManager;)V
      The following are the two pom.xml's I have.
      commons pom.xml:
      Code:
          <dependencies>
              <dependency>
                  <groupId>junit</groupId>
                  <artifactId>junit</artifactId>
                  <version>4.4</version>
                  <scope>test</scope>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-test</artifactId>
                  <version>2.5</version>
                  <scope>test</scope>
              </dependency>
              <dependency>
                  <groupId>javax.persistence</groupId>
                  <artifactId>persistence-api</artifactId>
                  <version>1.0</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring</artifactId>
                  <version>2.5</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-aop</artifactId>
                  <version>2.5</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-hibernate3</artifactId>
                  <version>2.0.7</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>mysql</groupId>
                  <artifactId>mysql-connector-java</artifactId>
                  <version>5.0.5</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.acegisecurity</groupId>
                  <artifactId>acegi-security</artifactId>
                  <version>1.0.5</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>aspectj</groupId>
                  <artifactId>aspectjrt</artifactId>
                  <version>1.5.3</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>aspectj</groupId>
                  <artifactId>aspectjweaver</artifactId>
                  <version>1.5.3</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>commons-logging</groupId>
                  <artifactId>commons-logging</artifactId>
                  <version>1.1</version>
                  <scope>provided</scope>
              </dependency>
          </dependencies>
      Module pom.xml dependencies.
      Code:
          <dependencies>
              <dependency>
                  <groupId>junit</groupId>
                  <artifactId>junit</artifactId>
                  <version>4.4</version>
                  <scope>test</scope>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-test</artifactId>
                  <version>2.5</version>
                  <scope>test</scope>
              </dependency>
              <dependency>
                  <groupId>javax.persistence</groupId>
                  <artifactId>persistence-api</artifactId>
                  <version>1.0</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring</artifactId>
                  <version>2.5</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-webmvc</artifactId>
                  <version>2.5</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-aop</artifactId>
                  <version>2.5</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-hibernate3</artifactId>
                  <version>2.0.7</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>mysql</groupId>
                  <artifactId>mysql-connector-java</artifactId>
                  <version>5.0.5</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.acegisecurity</groupId>
                  <artifactId>acegi-security</artifactId>
                  <version>1.0.6</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.acegisecurity</groupId>
                  <artifactId>acegi-security-tiger</artifactId>
                  <version>1.0.6</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>aspectj</groupId>
                  <artifactId>aspectjrt</artifactId>
                  <version>1.5.3</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>aspectj</groupId>
                  <artifactId>aspectjweaver</artifactId>
                  <version>1.5.3</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <type>jar</type>
                  <groupId>cas</groupId>
                  <artifactId>casclient</artifactId>
                  <version>2.1.1</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate</artifactId>
                  <version>3.2.5.ga</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-annotations</artifactId>
                  <version>3.2.1.ga</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-entitymanager</artifactId>
                  <version>3.2.1.ga</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-commons-annotations</artifactId>
                  <version>3.0.0.ga</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-validator</artifactId>
                  <version>3.0.0.ga</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>commons-dbcp</groupId>
                  <artifactId>commons-dbcp</artifactId>
                  <version>1.2</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>xerces</groupId>
                  <artifactId>xercesImpl</artifactId>
                  <version>2.8.1</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>concurrent</groupId>
                  <artifactId>concurrent</artifactId>
                  <version>1.3.4</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>org.apache.velocity</groupId>
                  <artifactId>velocity</artifactId>
                  <version>1.5</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>commons-collections</groupId>
                  <artifactId>commons-collections</artifactId>
                  <version>3.2</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>commons-logging</groupId>
                  <artifactId>commons-logging</artifactId>
                  <version>1.1</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>net.sf.ehcache</groupId>
                  <artifactId>ehcache</artifactId>
                  <version>1.3.0</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>ca.sfu.cs</groupId>
                  <artifactId>commons</artifactId>
                  <version>0.0.2</version>
              </dependency>
          </dependencies>

      Your help would be MUCH appreciated.

      Thank you
      Regards,

      Nathan.

      Comment

      Working...
      X