我不知道为什么这个错误会出现在我的项目中。所以你们是我的最后一次机会:
在我的项目中我得到“java.lang.ClassNotFoundException”异常。你能告诉我它背后的原因是什么。
when I am trying to run this program I am getting this message"
HTTP status 404
INSIDE the console I am getting this error
如果你能给我一些提示,那将非常感激......
非常感谢,
SEVERE: Error configuring application listener of class org.apache.struts2.tiles.StrutsTilesListener
java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Nov 24, 2012 4:47:54 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class com.olec.listener.HibernateListener
java.lang.ClassNotFoundException: com.olec.listener.HibernateListener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4537)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5097)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5092)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Nov 24, 2012 4:47:54 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
Nov 24, 2012 4:47:54 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Nov 24, 2012 4:47:54 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/OLEC] startup failed due to previous errors
Nov 24, 2012 4:47:54 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/OLEC] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been unregistered.
Nov 24, 2012 4:47:54 PM org.apache.coyote.AbstractProtocolHandler start
: Starting ProtocolHandler ["http-bio-8080"]
Nov 24, 2012 4:47:54 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Nov 24, 2012 4:47:54 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2014 ms
答案 0 :(得分:1)
您使用的是什么IDE?如果Eclipse或Netbeans得到项目属性并添加 将jar丢失到类路径中。
根据您的例外情况,您应该添加struts2-tiles-plugin-2.0.12.jar或该jar的任何其他版本。
另外hibernate-annotations.jar,更好地检查你的类路径是否正确。
答案 1 :(得分:0)
com.olec.listener.HibernateListener缺失。我发现没有包含该类的jar,但您应该将其添加到您的应用程序或其类路径中。