4

I'm facing with this problem when I try to run the application:

WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:CongressApp' did not find a matching property. May 13, 2014 1:35:26 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Error configuring application listener of class org.apache.catalina.deploy.ApplicationListener@bdeab java.lang.ClassNotFoundException: com.iss.congress.core.util.CongressContextListener at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4854) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:656) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1635) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722)

May 13, 2014 1:35:26 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Error configuring application listener of class org.apache.catalina.deploy.ApplicationListener@6a5b20 java.lang.ClassNotFoundException: com.iss.congress.core.util.CongressHttpSessionListener at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4854) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:656) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1635) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722)

May 13, 2014 1:35:26 PM org.apache.catalina.core.StandardContext listenerStart SEVERE: Error configuring application listener of class org.apache.catalina.deploy.ApplicationListener@1bacb12 java.lang.ClassNotFoundException: com.iss.congress.core.util.HibernateListener at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4854) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:656) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1635) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722)

In web.xml listeners are configured in this manner:

<listener>
        <listener-class>com.iss.congress.core.util.CongressContextListener</listener-class>
    </listener>

    <listener>
        <listener-class>com.iss.congress.core.util.CongressHttpSessionListener</listener-class>
    </listener>


    <listener>
        <display-name>Hibernate Session Listener</display-name>
        <listener-class>com.iss.congress.core.util.HibernateListener</listener-class>
    </listener>
Slava Chirița
  • 103
  • 1
  • 2
  • 10

4 Answers4

6

This is a case of java.lang.ClassNotFoundException: com.iss.congress.core.util.HibernateListener which means that the class HibernateListener is not present in the class path. Make sure that the jar containing this class is present in the WEB-INF/lib folder of your application.

If the class is present in the src folder then check the package name. Package names/Class Names are case-sensitive.

AdityaKeyal
  • 1,208
  • 8
  • 14
  • Thank you for reply. Unfortunately I checked the spelling and I found no problem – Slava Chirița May 13 '14 at 11:43
  • 1
    I tried to delete the server on Eclipse IDE and, then, create it again. This steps fixed the problem. Could you explain why did this problem occure? – Slava Chirița May 13 '14 at 12:11
  • 3
    This could have been a problem with caching. Rarely what does happen is that eclipse+tomcat caches an earlier version of the war partially (due to thread hold). Thus resulting in this problem. If you face a situation where by your changes are not reflected you can also try to `Clea Tomcat Work Directory` next time. – AdityaKeyal May 13 '14 at 12:22
1

There can be any of the following reasons:

  1. Either, your class file is not available on specified location (check your package_name/class_file_name.java)

  2. OR, your file exist at specified location but there is an error in your file, that could be built (generate class file)

(for me, the reason for an issue was point no. 2.) The root cause of an issue was, I changed (upgraded) version of rest libraries, which caused an issue with existing class files.


I resolved an issue by adding/selecting proper apache tomcat server.

Project Properties => Java Build Path => Add Library => Select Server Runtime => click Next and Select "Apache Tomcat" => Finish

Krunal
  • 77,632
  • 48
  • 245
  • 261
1

It happened that I edited in the listener class and after I saved it and republish the app to tomcat I found that error of class not found.
What I did was to remove my updates in the listener class, republish to tomcat, then add the updates again.. I did this because I suspected that there is a problem in eclipse in .class generation for any reason, although I cleaned the projects several times.
Removing my updates, saving (to have a new compiled version of the class), then adding my updates back again has resolved the issue for me.
Yes this seems illogic, but IDEs issues occur sometimes.

Hasnaa Ibraheem
  • 1,132
  • 1
  • 10
  • 18
0

In my case some jar files was missing like javax.ejb-api-3.2.jar missing in Tomcat directory in libs folder. also check jars libs of your .m2 repository of project.

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 30 '22 at 16:55