Announcement Announcement Module
Collapse
No announcement yet.
Application failed to start after upgrade to Spring 3.1 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Application failed to start after upgrade to Spring 3.1

    After I upgraded my projects from Spring 3.0.6 to 3.1 release, they cannot start in Glassfish, the error messages are:


    Code:
    WARN: Error in annotation processing: java.lang.NoClassDefFoundError: org/springframework/beans/factory/Aware
    ......
    SEVERE: java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlBeanDefinitionReader.setEnvironment(Lorg/springframework/core/env/Environment;)V
    	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:87)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)
    	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436)
    	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
    	at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4750)
    	at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:550)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:5366)
    	at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2000)
    	at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1651)
    	at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
    	at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
    	at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
    	at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:294)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:462)
    	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
    	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
    	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
    	at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:459)
    	at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:209)
    	at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
    	at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
    	at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
    	at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
    	at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
    	at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    	at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    	at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    	at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    	at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    	at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    	at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    	at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    	at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    	at java.lang.Thread.run(Thread.java:680)
    It is claimed that Spring 3.1 is 100% compatitable with the previous versions 3.0.x, but for my project seems it is not. Should I do some changes to the old configurations?

  • #2
    Judging from the stack trace you have some old jars in your class path somewhere or have duplicate jars resulting in class loading issues.

    Comment


    • #3
      Yeah, i use Maven for lib maintaince and use spring ldap 1.3 in my project, which depends on Spring 3.0.5. It is ok now after I exclude the old Spring libs

      Comment


      • #4
        Originally posted by mustangxu View Post
        Yeah, i use Maven for lib maintaince and use spring ldap 1.3 in my project, which depends on Spring 3.0.5. It is ok now after I exclude the old Spring libs
        Could you please discribe how you excluded the old Spring libs? I'm using intellij/maven and need spring-web 3.1.0 but have 2.5.6 sticking around even though i explicitly have
        Code:
        <dependency>
        			<groupId>org.springframework</groupId>
        			<artifactId>spring-web</artifactId>
        			<version>3.1.0.RELEASE</version>
        
        		</dependency>
        if you could describe how you got rid of the old references that would be a big help.

        Thanks,

        Andrew

        Comment


        • #5
          You need to identify which jar is actually responsible for bringing in the old jars and then go to its dependency declaration in POM and write something like

          <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
          <version>${spring.core.version}</version>
          <scope>compile</scope>
          <exclusions>
          <!-- Exclude Commons Logging in favor of SLF4j -->
          <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
          </exclusion>
          </exclusions>
          </dependency>


          Comment

          Working...
          X