在上下文路径 [/VirtualStore] 上部署了基于 servlet 的 Web 应用程序,但上下文无法从以下日志启动。2021 年 3 月 19 日 11:46:35.075 INFO [main] org.apache.catalina.startup.HostConfig。
在上下文路径 [/VirtualStore] 上部署了基于 servlet 的 Web 应用程序,但上下文无法启动,并显示以下日志。
19-Mar-2021 11:46:35.075 INFO [main] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor [C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\conf\Catalina\localhost\VS.xml] has finished in [448] ms
19-Mar-2021 11:46:35.079 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\webapps\docs]
19-Mar-2021 11:46:35.291 WARNING [main] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [143] milliseconds.
19-Mar-2021 11:46:35.306 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\webapps\docs] has finished in [228] ms
19-Mar-2021 11:46:35.307 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\webapps\examples]
19-Mar-2021 11:46:35.613 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\webapps\examples] has finished in [307] ms
19-Mar-2021 11:46:35.613 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\webapps\host-manager]
19-Mar-2021 11:46:35.646 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\webapps\host-manager] has finished in [32] ms
19-Mar-2021 11:46:35.646 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\webapps\manager]
19-Mar-2021 11:46:35.676 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\webapps\manager] has finished in [29] ms
19-Mar-2021 11:46:35.676 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\webapps\ROOT]
19-Mar-2021 11:46:35.703 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\webapps\ROOT] has finished in [27] ms
19-Mar-2021 11:46:35.708 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8085"]
19-Mar-2021 11:46:35.726 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [1894] milliseconds
19-Mar-2021 11:46:36.546 INFO [http-nio-8085-exec-9] org.apache.catalina.startup.HostConfig.undeploy Undeploying context [/VirtualStore]
19-Mar-2021 11:46:36.562 INFO [http-nio-8085-exec-4] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying deployment descriptor [C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\conf\Catalina\localhost\VirtualStore.xml]
19-Mar-2021 11:46:36.563 WARNING [http-nio-8085-exec-4] org.apache.catalina.startup.HostConfig.deployDescriptor The path attribute with value [/VirtualStore] in deployment descriptor [C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\conf\Catalina\localhost\VirtualStore.xml] has been ignored
19-Mar-2021 11:46:36.934 SEVERE [http-nio-8085-exec-4] org.apache.catalina.startup.HostConfig.deployDescriptor Error deploying deployment descriptor [C:\Users\Ing.Girbson BIJOU\Documents\NetBeansProjects\apache-tomcat-10.0.4-windows-x64\apache-tomcat-10.0.4\conf\Catalina\localhost\VirtualStore.xml]
java.lang.IllegalStateException: Error starting child
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:720)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:743)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:692)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:540)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1777)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:288)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1570)
at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:1022)
at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:357)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:663)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:223)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:126)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:185)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:158)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:668)
at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:378)
at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:56)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:353)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:870)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1696)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/VirtualStore]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
... 44 more
Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2470)
at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:866)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1370)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1224)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:540)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:521)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:151)
at org.apache.catalina.core.ApplicationContext.addListener(ApplicationContext.java:1086)
at org.apache.catalina.core.ApplicationContextFacade.addListener(ApplicationContextFacade.java:664)
at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:92)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5115)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 45 more
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletRequestListener
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1401)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1224)
... 60 more
Tomcat 可以在部署时使用适用于 Jakarta EE 的 Apache Tomcat 迁移工具将现有 Web 应用程序从 Java EE 8 转换为 Jakarta EE 9。要使用该功能,应将 Web 应用程序放在主机 legacyAppBase 文件夹中(默认名为 webapps-javaee),然后它们将转换为主机 appBase 文件夹中的等效 Jakarta EE Web 应用程序(默认名为 webapps)。
基本上,已部署的 Web 应用程序正在寻找 javax.servlet.* ,但实际上应该寻找 jakarta.servlet.* 。也就是说, javax.* ,包已重命名为 jakarta.* 包。这意味着已部署的 Web 应用程序实际上与 Jakarta EE 版本 9 不兼容。已部署的 Web 应用程序很可能是为较旧的 JEE 版本开发的,其中 javax.* 仍使用该包。