Results 1 to 6 of 6

Thread: Upgrade Spring 2.0.3 to 2.0.5 error

  1. #1

    Default Upgrade Spring 2.0.3 to 2.0.5 error

    servus,

    I develop a webapp using maven2, spring2 and jetty6. Everything works fine until I decided to update to the latest spring version (from 2.0.3 to 2.0.5).

    Now I have got the following error
    Code:
    [INFO] DispatcherServlet - FrameworkServlet 'grabbl': initialization started
    2007-06-20 16:15:49.980::WARN:  failed grabbl
    java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.addApplicationListener(Lorg/springframework/context/ApplicationListener;)V
            at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:329)
            at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:266)
            at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:236)
            at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
            at javax.servlet.GenericServlet.init(GenericServlet.java:241)
            at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:433)
            at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
            at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:617)
            at org.mortbay.jetty.servlet.Context.startContext(Context.java:139)
            at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1218)
            at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:500)
            at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
            at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
            at org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
            at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:147)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
            at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:117)
            at org.mortbay.jetty.Server.doStart(Server.java:220)
            at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
            at org.mortbay.jetty.plugin.Jetty6PluginServer.start(Jetty6PluginServer.java:132)
            at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:345)
            at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:286)
            at org.mortbay.jetty.plugin.AbstractJettyRunMojo.execute(AbstractJettyRunMojo.java:204)
            at org.mortbay.jetty.plugin.Jetty6RunMojo.execute(Jetty6RunMojo.java:183)
            at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
            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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
            at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
            at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
            at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
    Does someone have had the same problem, while upgrading?
    Or does anyone know what I have to do?

  2. #2

    Default

    Locking in the changelog of spring I have found the following additional information in the Changes of version 2.0.4 (2007-04-10)

    http://static.springframework.org/sp.../changelog.txt

    Code:
    Package org.springframework.context
    * added "addApplicationListener" method to ConfigurableApplicationContext interface, for statically registered listeners

  3. #3
    Join Date
    Nov 2005
    Location
    Reutlingen, Germany
    Posts
    2,098

    Default

    I'd guess you have some conflicting jars flying around (of both the old and the new Spring version). The NoSuchMethodError can only occur if the code calling this method was compiled against code that had the method. Otherwise you obviously would have a compiler error.

    Jörg

  4. #4

    Thumbs up

    Thanks Jörg,

    I also use the spring lucene modules 0.8. This package requires spring 2.0.3. I did not check that maven dependency.
    Now I switched back to spring 2.0.3.

    Greetings from Leipzig and some of your old teammates from Virbus
    Tobias

  5. #5
    Join Date
    Jul 2007
    Posts
    1

    Default Error returns with 2.0.6

    My log states:

    *ERROR* [/infospring]: StandardWrapper.Throwable (ApplicationContext.java, line 660)
    java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApp licationContext.addApplicationListener(Lorg/springframework/context/ApplicationListener;)V

    and a grep -r "addApplicationListener" * reveals :

    spring-framework-2.0.6/src/org/springframework/web/servlet/FrameworkServlet.java: wac.addApplicationListener(this);
    spring-framework-2.0.6/src/org/springframework/web/portlet/FrameworkPortlet.java: pac.addApplicationListener(new SourceFilteringListener(pac, this));
    spring-framework-2.0.6/src/org/springframework/context/event/AbstractApplicationEventMulticaster.java: public void addApplicationListener(ApplicationListener listener) {
    spring-framework-2.0.6/src/org/springframework/context/event/ApplicationEventMulticaster.java: void addApplicationListener(ApplicationListener listener);
    spring-framework-2.0.6/src/org/springframework/context/ConfigurableApplicationContext.java: void addApplicationListener(ApplicationListener listener);
    spring-framework-2.0.6/src/org/springframework/context/support/AbstractApplicationContext.java: public void addApplicationListener(ApplicationListener listener) {
    spring-framework-2.0.6/src/org/springframework/context/support/AbstractApplicationContext.java: getApplicationEventMulticaster().addApplicationLis tener(listener);


    and I find no other place referring to "addApplicationListener"...

  6. #6
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    I have a look and ensure you don't have duplicate Spring JARs on the classpath.
    Last edited by karldmoore; Aug 29th, 2007 at 11:03 AM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •