У меня есть webapp, который отлично работает на месте. Когда я пытаюсь развернуть его на новой установке debian (только что установил tomcat8 и JDK 8 из oracle), у меня есть исключение ClassNotFoudn на моем ContextListener. Есть следы в журнале, показывающие, что слушатель сделал начало, но (я думаю) из-за исключения контекст не запущен, и я получаю 404 на каждый URL.ClassNotFound on ContextListener (но его найдено!)
Журналы:
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 !!");
}
Любая идея?
Вау, спасибо, что заметили этот. Вероятно, некоторые администраторы скопировали webapp в каталоге ROOT, надеясь, что он разрешит еще одну проблему, чего не было. – FTregan
Хорошо, я рад. Но если бы это было полезно для вас, не забудьте запереть (и это полностью решает проблему, поставит ее как лучший ответ). –