BUG生产坊
作者:互联网
今天想在本地tomcat上,试下打完包的项目是否能正常运行。然后就下载tomcat-8.5.31版本的(在用的是tomcat-8.0.53版本的),修改了一下端口,避免两个tomcat的端口冲突。
1.<Server port="18005" shutdown="SHUTDOWN"> 修改端口8005 > 18005
2.<Connector port="8088" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />修改端口号8080 > 8088
3.<Connector port="18009" protocol="AJP/1.3" redirectPort="8443" /> 修改端口8009 > 18009
将server.xml文件的这三个值修改了之后
修改bin文件夹下面的catalina.bat和startup.bat把其中的CATALINA_HOME改下,避免和另一个tomcat冲突。
修改配置 CATALINA_HOME >CATALINA_HOME1
修改完了后双击startup.bat
09-Nov-2021 15:10:41.752 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.5.31
09-Nov-2021 15:10:41.755 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Apr 27 2018 20:24:25 UTC
09-Nov-2021 15:10:41.757 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.5.31.0
09-Nov-2021 15:10:41.757 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10
09-Nov-2021 15:10:41.757 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.0
09-Nov-2021 15:10:41.758 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
09-Nov-2021 15:10:41.758 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: D:\workApp\jdk\jdk1.8.0_152\jre
09-Nov-2021 15:10:41.758 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_152-b16
09-Nov-2021 15:10:41.758 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
09-Nov-2021 15:10:41.760 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: D:\workApp\apache-tomcat-8.5.31
09-Nov-2021 15:10:41.760 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: D:\workApp\apache-tomcat-8.5.31
09-Nov-2021 15:10:41.760 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=D:\workApp\apache-tomcat-8.5.31\conf\logging.properties
09-Nov-2021 15:10:41.760 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
09-Nov-2021 15:10:41.760 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
09-Nov-2021 15:10:41.760 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
09-Nov-2021 15:10:41.760 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
09-Nov-2021 15:10:41.761 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=D:\workApp\apache-tomcat-8.5.31
09-Nov-2021 15:10:41.762 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=D:\workApp\apache-tomcat-8.5.31
09-Nov-2021 15:10:41.762 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=D:\workApp\apache-tomcat-8.5.31\temp
09-Nov-2021 15:10:41.762 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.6.3].
09-Nov-2021 15:10:41.763 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
09-Nov-2021 15:10:41.763 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
09-Nov-2021 15:10:42.364 信息 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.0.2m 2 Nov 2017]
09-Nov-2021 15:10:42.448 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8088"]
09-Nov-2021 15:10:42.740 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
09-Nov-2021 15:10:42.744 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-18009"]
09-Nov-2021 15:10:42.746 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
09-Nov-2021 15:10:42.746 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1233 ms
09-Nov-2021 15:10:42.764 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
09-Nov-2021 15:10:42.764 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.31
09-Nov-2021 15:10:42.772 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\workApp\apache-tomcat-8.5.31\webapps\docs]
09-Nov-2021 15:10:42.968 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\workApp\apache-tomcat-8.5.31\webapps\docs] has finished in [195] ms
09-Nov-2021 15:10:42.968 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\workApp\apache-tomcat-8.5.31\webapps\examples]
09-Nov-2021 15:10:43.172 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\workApp\apache-tomcat-8.5.31\webapps\examples] has finished in [204] ms
09-Nov-2021 15:10:43.172 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\workApp\apache-tomcat-8.5.31\webapps\host-manager]
09-Nov-2021 15:10:43.195 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\workApp\apache-tomcat-8.5.31\webapps\host-manager] has finished in [23] ms
09-Nov-2021 15:10:43.195 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\workApp\apache-tomcat-8.5.31\webapps\manager]
09-Nov-2021 15:10:43.213 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\workApp\apache-tomcat-8.5.31\webapps\manager] has finished in [18] ms
09-Nov-2021 15:10:43.213 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\workApp\apache-tomcat-8.5.31\webapps\ROOT]
09-Nov-2021 15:10:43.227 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\workApp\apache-tomcat-8.5.31\webapps\ROOT] has finished in [14] ms
09-Nov-2021 15:10:43.229 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8088"]
09-Nov-2021 15:10:43.238 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-18009"]
09-Nov-2021 15:10:43.240 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 493 ms
正常启动,然后浏览器访问
一切都是正常的,然后就在idea上配置这个8.5版本的tomcat后,运行报如下错误
09-Nov-2021 14:42:01.939 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
09-Nov-2021 14:42:01.945 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-18009"]
09-Nov-2021 14:42:01.947 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 33 ms
Connected to server
[2021-11-09 02:42:02,195] Artifact HBJOA-Web: Artifact is being deployed, please wait...
09-Nov-2021 14:42:03.632 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.tomcat.util.descriptor.web.WebXmlParser.parseWebXml Parse error in application web.xml file at [file:/D:/workApp/apache-tomcat-8.5.31/webapps/HBJOA_Web/WEB-INF/web.xml]
java.io.FileNotFoundException: Could not resolve XML resource [null] with public ID [null], system ID [workflow.xml] and base URI [file:/D:/workApp/apache-tomcat-8.5.31/webapps/HBJOA_Web/WEB-INF/web.xml] to a known, local entity.
at org.apache.tomcat.util.descriptor.LocalResolver.resolveEntity(LocalResolver.java:155)
at com.sun.org.apache.xerces.internal.util.EntityResolver2Wrapper.resolveEntity(EntityResolver2Wrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntityAsPerStax(XMLEntityManager.java:997)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1212)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEntityReference(XMLDocumentFragmentScannerImpl.java:1908)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3061)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1521)
at org.apache.tomcat.util.descriptor.web.WebXmlParser.parseWebXml(WebXmlParser.java:119)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1104)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:765)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1736)
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:300)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:482)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:431)
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:300)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at com.sun.jmx.remote.security.MBeanServerAccessController.invoke(MBeanServerAccessController.java:468)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
at java.security.AccessController.doPrivileged(Native Method)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1408)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
09-Nov-2021 14:42:03.662 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.startup.ContextConfig.configureStart Marking this application unavailable due to previous error(s)
09-Nov-2021 14:42:03.668 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more components marked the context as not correctly configured
09-Nov-2021 14:42:03.670 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [/HBJOA_Web] startup failed due to previous errors
这是参照我之前8.0版本的tomcat配置方式配置的,检查了很多次,排除配置错误的情况。
想着8.5不好用,那就在弄8.0来实现目的吧,又解压了一份tomcat-8.0.53版本,还是一样的修改端口,修改配置。然而双击startup.bat后
直接闪退,寻思着难道新加的端口占用了?用netstat -ano查了下,不是占用的问题,难道还需要配其他环境变量?看来一篇大佬的文章https://www.cnblogs.com/qq765065332/p/7694775.html
也排除了环境的问题。想着之前项目使用过程一直没问题,就照之前的配置在idea又来了一次,然而它没报错,项目启动了,妈卖批。
问题记录
tomcat-8.5.31版本的,测试没问题,但配置idea上后报错。
tomcat-8.0.53版本的,测试闪退,配置idea后没有问题。
标签:catalina,java,apache,2021,生产,org,Nov,BUG 来源: https://blog.csdn.net/read_/article/details/121229901