0

我不知道为什么我的项目会出现这个错误。所以你们是我最后的机会:

在我的项目中,我收到“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
4

2 回答 2

1

你用的是什么IDE?如果 Eclipse 或 Netbeans 进入项目属性并将缺少的 jar 添加到类路径中。

根据您的例外情况,您应该添加 struts2-tiles-plugin-2.0.12.jar 或该 jar 的任何其他版本。

还有 hibernate-annotations.jar ,更好地检查你的类路径是否正确。

于 2012-11-24T12:39:49.123 回答
0

com.olec.listener.HibernateListener 丢失。我没有找到包含该类的 jar,但您应该将其添加到您的应用程序或其类路径中。

于 2012-11-25T10:21:21.807 回答