1

On starting my jboss application server, I am getting following error:

0:27:03,456 INFO  [org.springframework.web.context.ContextLoader] (MSC service thread 1-5) Root WebApplicationContext: initialization started
10:27:03,479 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-5) Context initialization failed: java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.setId(Ljava/lang/String;)V
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:264) [org.springframework.web-3.0.3.RELEASE.jar:3.0.3.RELEASE]
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) [org.springframework.web-3.0.3.RELEASE.jar:3.0.3.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) [org.springframework.web-3.0.3.RELEASE.jar:3.0.3.RELEASE]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.17.Final-redhat-1.jar:]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.17.Final-redhat-1.jar:]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:89) [jboss-as-web-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

the application works fine on my local windows machine, and I have exactly the same server in the UNIX machine, where it does not work.

Any pointers would be very helpful.

Kevin Bowersox
  • 93,289
  • 19
  • 159
  • 189
Ankit
  • 3,083
  • 7
  • 35
  • 59
  • It seems that you are using different version of Spring on UNIX. Please check this link: http://stackoverflow.com/questions/18601279/java-lang-nosuchmethoderror-org-springframework-web-context-configurablewebappl – longhua Oct 10 '13 at 09:03
  • (1) Are the Spring JARs packaged inside your application or do they exist in an external library? (2) Can you confirm that there are not 2 versions of the JARs inside your application *at the same time*? (e.g. `spring-3.0.3.jar`, `spring-2.5.3.jar`) – Nikos Paraskevopoulos Oct 10 '13 at 10:59
  • @NikosParaskevopoulos: This was indeed the issue. :( – Ankit Oct 10 '13 at 13:24

1 Answers1

1

This indicates that one of your Spring Jars is the wrong version. ConfigurableWebApplicationContext does not have the setId method in version 2.0. But this method does appear in the version 3.x version of Spring.

Kevin Bowersox
  • 93,289
  • 19
  • 159
  • 189
  • But, I have the same application and server on local windows machine which works absolutely fine. – Ankit Oct 10 '13 at 09:58
  • It was due to another spring jar which was there in my war. Fixed it. Although not able to understand why I only got issue on UNIX machine and not my local windows machine. I guess something to do with classloading. – Ankit Oct 10 '13 at 13:25