服务器输出:
D:\Path\TomCat\apache-tomcat-9.0.75\bin\catalina.bat run
[2023-05-20 01:31:40,537] 工件 servlet-01:war: 正在等待服务器连接以启动工件部署…
Using CATALINA_BASE: "C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2021.3\tomcat\aec6f1f2-ce40-487e-8034-e257ab2da816"
Using CATALINA_HOME: "D:\Path\TomCat\apache-tomcat-9.0.75"
Using CATALINA_TMPDIR: "D:\Path\TomCat\apache-tomcat-9.0.75\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk-11"
Using CLASSPATH: "D:\Path\TomCat\apache-tomcat-9.0.75\bin\bootstrap.jar;D:\Path\TomCat\apache-tomcat-9.0.75\bin\tomcat-juli.jar"
Using CATALINA_OPTS: ""
NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
20-May-2023 13:31:41.373 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server.服务器版本: Apache Tomcat/9.0.75
20-May-2023 13:31:41.375 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 服务器构建: May 4 2023 13:04:05 UTC
20-May-2023 13:31:41.376 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 服务器版本号: 9.0.75.0
20-May-2023 13:31:41.376 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 操作系统名称: Windows 10
20-May-2023 13:31:41.376 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS.版本: 10.0
20-May-2023 13:31:41.376 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 架构: amd64
20-May-2023 13:31:41.376 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java 环境变量: C:\Program Files\Java\jdk-11
20-May-2023 13:31:41.376 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java虚拟机版本: 11.0.18+9-LTS-195
20-May-2023 13:31:41.376 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM.供应商: Oracle Corporation
20-May-2023 13:31:41.376 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2021.3\tomcat\aec6f1f2-ce40-487e-8034-e257ab2da816
20-May-2023 13:31:41.376 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: D:\Path\TomCat\apache-tomcat-9.0.75
20-May-2023 13:31:41.377 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.base/java.lang=ALL-UNNAMED
20-May-2023 13:31:41.377 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.base/java.io=ALL-UNNAMED
20-May-2023 13:31:41.377 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.base/java.util=ALL-UNNAMED
20-May-2023 13:31:41.377 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
20-May-2023 13:31:41.378 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
20-May-2023 13:31:41.378 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.util.logging.config.file=C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2021.3\tomcat\aec6f1f2-ce40-487e-8034-e257ab2da816\conf\logging.properties
20-May-2023 13:31:41.378 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
20-May-2023 13:31:41.378 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote=
20-May-2023 13:31:41.378 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote.port=1099
20-May-2023 13:31:41.378 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote.ssl=false
20-May-2023 13:31:41.378 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote.password.file=C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2021.3\tomcat\aec6f1f2-ce40-487e-8034-e257ab2da816\jmxremote.password
20-May-2023 13:31:41.378 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcom.sun.management.jmxremote.access.file=C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2021.3\tomcat\aec6f1f2-ce40-487e-8034-e257ab2da816\jmxremote.access
20-May-2023 13:31:41.378 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.rmi.server.hostname=127.0.0.1
20-May-2023 13:31:41.378 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djdk.tls.ephemeralDHKeySize=2048
20-May-2023 13:31:41.378 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
20-May-2023 13:31:41.379 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dignore.endorsed.dirs=
20-May-2023 13:31:41.379 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcatalina.base=C:\Users\User\AppData\Local\JetBrains\IntelliJIdea2021.3\tomcat\aec6f1f2-ce40-487e-8034-e257ab2da816
20-May-2023 13:31:41.379 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Dcatalina.home=D:\Path\TomCat\apache-tomcat-9.0.75
20-May-2023 13:31:41.379 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 命令行参数: -Djava.io.tmpdir=D:\Path\TomCat\apache-tomcat-9.0.75\temp
20-May-2023 13:31:41.381 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent 使用APR版本[1.7.2]加载了基于APR的Apache Tomcat本机库[1.2.36]。
20-May-2023 13:31:41.382 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR功能:IPv6[true]、sendfile[true]、accept filters[false]、random[true]、UDS [true]。
20-May-2023 13:31:41.382 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL配置:useAprConnector[false],useOpenSSL[true]
20-May-2023 13:31:41.384 信息 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL成功初始化 [OpenSSL 1.1.1t 7 Feb 2023]
20-May-2023 13:31:41.536 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["http-nio-8080"]
20-May-2023 13:31:41.550 信息 [main] org.apache.catalina.startup.Catalina.load 服务器在[344]毫秒内初始化
20-May-2023 13:31:41.602 信息 [main] org.apache.catalina.core.StandardService.startInternal 正在启动服务[Catalina]
20-May-2023 13:31:41.604 信息 [main] org.apache.catalina.core.StandardEngine.startInternal 正在启动 Servlet 引擎:[Apache Tomcat/9.0.75]
20-May-2023 13:31:41.615 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["http-nio-8080"]
20-May-2023 13:31:41.629 信息 [main] org.apache.catalina.startup.Catalina.start [79]毫秒后服务器启动
已连接到服务器
[2023-05-20 01:31:41,735] 工件 servlet-01:war: 正在部署工件,请稍候…
20-May-2023 13:31:41.987 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.tomcat.util.modeler.BaseModelMBean.invoke 调用方法[manageApp]时发生异常
java.lang.IllegalStateException: 启动子级时出错
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:686)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:658)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:662)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1782)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:294)
at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809)
at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:460)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:408)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:294)
at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809)
at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at java.management/com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1466)
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1406)
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:827)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/servlet_01_war]]
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:683)
... 42 more
Caused by: java.lang.IllegalArgumentException: servlet映射中的<url pattern>[hello]无效
at org.apache.catalina.core.StandardContext.addServletMappingDecoded(StandardContext.java:3040)
at org.apache.catalina.Context.addServletMappingDecoded(Context.java:905)
at org.apache.catalina.startup.ContextConfig.configureContext(ContextConfig.java:1563)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1336)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:987)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:304)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4852)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 43 more
20-May-2023 13:31:41.989 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.tomcat.util.modeler.BaseModelMBean.invoke 调用方法[createStandardContext]时发生异常
javax.management.RuntimeOperationsException: 调用方法[manageApp]时发生异常
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:304)
at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809)
at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:460)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:408)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:294)
at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:809)
at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at java.management/com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1466)
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1307)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1406)
at java.management.rmi/javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:827)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: 启动子级时出错
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:686)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:658)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:662)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1782)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:294)
... 34 more
Caused by: org.apache.catalina.LifecycleException: 无法启动组件[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/servlet_01_war]]
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:683)
... 42 more
Caused by: java.lang.IllegalArgumentException: servlet映射中的<url pattern>[hello]无效
at org.apache.catalina.core.StandardContext.addServletMappingDecoded(StandardContext.java:3040)
at org.apache.catalina.Context.addServletMappingDecoded(Context.java:905)
at org.apache.catalina.startup.ContextConfig.configureContext(ContextConfig.java:1563)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1336)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:987)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:304)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4852)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 43 more
[2023-05-20 01:31:42,009] 工件 servlet-01:war: 部署工件时出错。请参阅服务器日志了解详细信息。
20-May-2023 13:31:51.629 信息 [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory 把web 应用程序部署到目录 [D:\Path\TomCat\apache-tomcat-9.0.75\webapps\manager]
20-May-2023 13:31:52.042 警告 [Catalina-utility-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom 使用[SHA1PRNG]创建会话ID生成的SecureRandom实例花费了[304]毫秒。
20-May-2023 13:31:52.069 信息 [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory Web应用程序目录[D:\Path\TomCat\apache-tomcat-9.0.75\webapps\manager]的部署已在[440]毫秒内完成
Tomcat日志:
处理办法:
1、检查web.xml文件<url-pattern>标签中路径前是否加'/'
2、新添加的jar包没有打进war包中,把需要的jar包添加到工件,则可以解决。