1
  • i am using JBoss 7.1
  • Eclipse and i have the following Jar files(commons-dbcp.jar,commons-logging.jar,commons-pool.jar,jstl.jar,log4j-1.2.15.jar,mysql-connector-java-5.1.6-bin.jar,spring.jar,spring-webmvc.jar,standard.jar)

when i am trying to Debug my project i get the following error

22:12:07,196 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/OnlinemployeeDB]] (MSC service thread 1-2) Error configuring application listener of class org.springframework.web.context.ContextLoaderListener: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module "deployment.OnlinemployeeDB.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
    at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:72) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3342) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    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.runWorker(Unknown Source) [rt.jar:1.7.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_25]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_25]

22:12:07,216 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/OnlinemployeeDB]] (MSC service thread 1-2) Skipped installing application listeners due to previous error(s)
22:12:07,218 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error listenerStart
22:12:07,219 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/OnlinemployeeDB] startup failed due to previous errors
22:12:07,222 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.web.deployment.default-host./OnlinemployeeDB: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./OnlinemployeeDB: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_25]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_25]

thank you in advance.

1

4 Answers 4

14

Try this.

  1. Right click on project name -> click on properties
  2. Go to Deployment Assembly
  3. Click on Add -> Java Build Path Entries -> Next
  4. Select Maven Dependencies -> Finish -> Apply -> OK
  5. Clean project and server. Restart the server
  6. Check console. ContextLoaderListener exception should not be generated now.
Sign up to request clarification or add additional context in comments.

2 Comments

i tried the steps but the problem is i do not have "Maven Dependencies"
First check whether your project is maven based. For that check the 'M' symbol of maven on top of the name of your project in eclipse. If not then right click on project -> configure -> Convert to maven project. Your project will be converted into the maven project. (This will may take some time as some required jars will be dowlnloaded.) After this clean project and try above steps.
1

It shows that you have missed some jar files. I guess one of the spring jar files is not packed with your war file, or maybe it does not exist in your destination application server, Are you deploying your application war file manually? BTW which version of Spring you are using?

4 Comments

what is the name of jar did i miss?
Which version of spring you are using?
ContextLoaderListener class exists inside spring-2.5.6 jar file, so make sure that this jar file exists in your war file when your are packing it.
Test your war file with a clean installation of another app server(such as tomcat) and check the result, maybe there is some problem with your jboss.
1

You are missing org.springframework.web.context.ContextLoaderListener, located in spring-web-VERSION.jar, from your runtime classpath. It doesn't help if they're on your build path if they cannot be found runtime. You need to package the .jars with your .war libs for them to be found.

1 Comment

@Djkgotso did you confirm from runtime classpath that it is there? You can print it out. It might be that you get it due to some other dependency that this dependency is needing... you can also try to debug jboss and catch the exception and examine it in the debugger.
0

You are missig one of the following thing while configure your application

  • Missing Jars

    Download latest Spring MVC 3.2.5 RELEASE jars from here

  • Add Jar files to Build Path

    Add your downloaded jar file into project Build path . Read this article link1 and link2.

hope this will solve your problem.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.