我有一个在本地工作正常的webapp。当我尝试在新的debian安装上部署它(刚从oracle安装tomcat8和JDK 8)时,我的ContextListener上有一个ClassNotFoudn异常。日志中有痕迹显示侦听器已经启动,但(我认为)因为异常没有启动上下文而且每个URL都获得404.
日志:
août 17, 2016 12:31:16 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server version: Apache Tomcat/8.0.14 (Debian)
août 17, 2016 12:31:16 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server built: Jun 24 2016 06:06:26
août 17, 2016 12:31:16 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Server number: 8.0.14.0
août 17, 2016 12:31:16 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: OS Name: Linux
août 17, 2016 12:31:16 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: OS Version: 3.16.0-4-amd64
août 17, 2016 12:31:16 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: Architecture: amd64
août 17, 2016 12:31:16 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: JVM Version: 1.8.0_101-b13
août 17, 2016 12:31:16 PM org.apache.catalina.startup.VersionLoggerListener log
INFOS: JVM Vendor: Oracle Corporation
août 17, 2016 12:31:17 PM org.apache.coyote.AbstractProtocol init
INFOS: Initializing ProtocolHandler ["http-nio-8080"]
août 17, 2016 12:31:17 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFOS: Using a shared selector for servlet write/read
août 17, 2016 12:31:17 PM org.apache.catalina.startup.Catalina load
INFOS: Initialization processed in 1179 ms
août 17, 2016 12:31:17 PM org.apache.catalina.core.StandardService startInternal
INFOS: Démarrage du service Catalina
août 17, 2016 12:31:17 PM org.apache.catalina.core.StandardEngine startInternal
INFOS: Starting Servlet Engine: Apache Tomcat/8.0.14 (Debian)
août 17, 2016 12:31:17 PM org.apache.catalina.startup.HostConfig deployWAR
INFOS: Déploiement de l'archive /var/lib/tomcat8/webapps/chouette.war de l'application web
Starting configuration <-- ** This trace shows that it DID start **
!! Running in test mode !!
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
!! Test mode : no crawnling from Typeform will be performmed
août 17, 2016 12:31:43 PM org.apache.catalina.startup.HostConfig deployWAR
INFOS: Deployment of web application archive /var/lib/tomcat8/webapps/chouette.war has finished in 25 675 ms
août 17, 2016 12:31:43 PM org.apache.catalina.startup.HostConfig deployDirectory
INFOS: Déploiement du répertoire /var/lib/tomcat8/webapps/ROOT de l'application web
août 17, 2016 12:31:44 PM org.apache.jasper.servlet.TldScanner scanJars
INFOS: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
août 17, 2016 12:31:44 PM org.apache.catalina.core.StandardContext listenerStart
GRAVE: Erreur lors de la configuration de la classe d'écoute de l'application (application listener) [MyContextListener]
java.lang.ClassNotFoundException: [MyContextListener]
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1293)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1145)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:520)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:501)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:120)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4753)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1071)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1721)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
août 17, 2016 12:31:44 PM org.apache.catalina.core.StandardContext listenerStart
GRAVE: Erreur lors de la configuration de la classe d'écoute de l'application (application listener) fr.gouv.beta.chouette.typeform.webapp.CrawlerRunnerServletContextListenerAdapter
java.lang.ClassNotFoundException: fr.gouv.beta.chouette.typeform.webapp.CrawlerRunnerServletContextListenerAdapter
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1293)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1145)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:520)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:501)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:120)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4753)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1071)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1721)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
MyContextListener中的:
@Override
public void contextInitialized(ServletContextEvent sce) {
System.out.println("Starting configuration");
if(testMode) {
System.out.println(" !! Running in test mode !!");
}
有什么想法吗?
答案 0 :(得分:0)
行:
开始配置
!!在测试模式下运行!!
..表明你的听众正在被执行;好。然后,行:
INFOS:部署Web应用程序存档/var/lib/tomcat8/webapps/chouette.war已于25 675 ms完成
..表示已部署chouette.war
。
ClassNotFound发生在以下行之后:
INFOS:Déploiementdurépertoire/ var / lib / tomcat8 / webapps / ROOT de l'application web
...在我看来,正在部署第二个应用程序,其中您的课程没有被很好地包括在内。你最好检查ROOT目录。