ClassNotFoundException Tomcat 7服务器

时间:2018-08-08 12:28:08

标签: eclipse tomcat7 classnotfoundexception

当我尝试通过Eclipse在Tomcat 7服务器上加载某些内容时遇到问题。 我已经下载了一个示例并尝试了一个示例,但是在我的浏览器中,它仅显示资源不可用。

Aug 08, 2018 2:23:51 PM org.apache.catalina.core.AprLifecycleListener init
INFORMATION: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_111\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_181/bin/server;C:/Program Files/Java/jre1.8.0_181/bin;C:/Program Files/Java/jre1.8.0_181/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python34\;C:\Python34\Scripts;C:\Program Files\Maven\apache-maven-3.3.9\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\IFOR\WIN\BIN;C:\IFOR\WIN\BIN\EN_US;C:\TwinCAT\Common32;C:\TwinCAT\Common64;C:\Program Files\Git\cmd;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\PuTTY\;C:\Users\stn\apache-ant-1.10.2\bin;C:\Program Files (x86)\Eclipse\eclipse neon RC3\eclipse;;.
Aug 08, 2018 2:23:51 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNUNG: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:0001' did not find a matching property.
Aug 08, 2018 2:23:51 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNUNG: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:primefaces-test-master' did not find a matching property.
Aug 08, 2018 2:23:51 PM org.apache.coyote.AbstractProtocol init
INFORMATION: Initializing ProtocolHandler ["http-bio-8080"]
Aug 08, 2018 2:23:51 PM org.apache.coyote.AbstractProtocol init
INFORMATION: Initializing ProtocolHandler ["ajp-bio-8009"]
Aug 08, 2018 2:23:51 PM org.apache.catalina.startup.Catalina load
INFORMATION: Initialization processed in 421 ms
Aug 08, 2018 2:23:51 PM org.apache.catalina.core.StandardService startInternal
INFORMATION: Starting service Catalina
Aug 08, 2018 2:23:51 PM org.apache.catalina.core.StandardEngine startInternal
INFORMATION: Starting Servlet Engine: Apache Tomcat/7.0.47
Aug 08, 2018 2:23:53 PM org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Error configuring application listener of class ${jsf-listener}
java.lang.ClassNotFoundException: ${jsf-listener}
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532)
	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:514)
	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:142)
	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$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Aug 08, 2018 2:23:53 PM org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Skipped installing application listeners due to previous error(s)
Aug 08, 2018 2:23:53 PM org.apache.catalina.core.StandardContext startInternal
SCHWERWIEGEND: Error listenerStart
Aug 08, 2018 2:23:53 PM org.apache.catalina.core.StandardContext startInternal
SCHWERWIEGEND: Context [/primefaces-test] startup failed due to previous errors
Aug 08, 2018 2:23:53 PM org.apache.catalina.core.ApplicationContext log
INFORMATION: Marking servlet Push Servlet as unavailable
Aug 08, 2018 2:23:53 PM org.apache.catalina.core.StandardContext loadOnStartup
SCHWERWIEGEND: Servlet /0001 threw load() exception
java.lang.ClassNotFoundException: org.atmosphere.cpr.AtmosphereServlet
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2918)
	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1174)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1669)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
	at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532)
	at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:514)
	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:142)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Aug 08, 2018 2:23:53 PM org.apache.coyote.AbstractProtocol start
INFORMATION: Starting ProtocolHandler ["http-bio-8080"]
Aug 08, 2018 2:23:53 PM org.apache.coyote.AbstractProtocol start
INFORMATION: Starting ProtocolHandler ["ajp-bio-8009"]
Aug 08, 2018 2:23:53 PM org.apache.catalina.startup.Catalina start
INFORMATION: Server startup in 2014 ms

这是我在服务器上运行示例时得到的。我无法修复ClassNotFoundException。有人知道吗?

它还说在第二个ClassNotFoundException上方两行,“ SCHWERWIEGEND:Servlet / 0001抛出load()异常”,但是/ 0001是同一工作空间中的另一个Project。

谢谢。

3 个答案:

答案 0 :(得分:0)

您需要编译代码原因文件(.class)不会生成

答案 1 :(得分:0)

具有$ ClassingFound的$ thingy逐字说明了这样的推测,即$ {jsf-listener}是一个无法解析的占位符表达式,因此找不到此类。因此某些配置可能会缺少“ jsf-listener”。但这只是一个推测。

配置类$ {jsf-listener}的应用程序侦听器时出错 java.lang.ClassNotFoundException:$ {jsf-listener}

答案 2 :(得分:0)

您的Tomcat工件不包含“ org.atmosphere”库。检查构建WAR文件的方式。如果是Maven,则需要添加库作为已编译的依赖项。