java 无法启动Tomcat

2vuwiymt  于 2023-01-24  发布在  Java
关注(0)|答案(8)|浏览(161)

我尝试在Netbeans中启动Tomcat,不幸的是它停留在“ Catalina ”。过了一会儿,我得到一个错误消息弹出窗口,说启动Tomcat失败。我使用的是Mac OS
这是我看到的所有输出:

29-Jan-2015 11:42:53.328 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.15
29-Jan-2015 11:42:53.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Nov 2 2014 19:25:20 UTC
29-Jan-2015 11:42:53.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.15.0
29-Jan-2015 11:42:53.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Mac OS X
29-Jan-2015 11:42:53.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            10.10.1
29-Jan-2015 11:42:53.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          x86_64
29-Jan-2015 11:42:53.329 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JAVA_HOME:             /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/jre
29-Jan-2015 11:42:53.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.7.0_25-b15
29-Jan-2015 11:42:53.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
29-Jan-2015 11:42:53.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /Users/Exceen/Library/Application Support/NetBeans/8.0.2/apache-tomcat-8.0.15.0_base
29-Jan-2015 11:42:53.330 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /Applications/NetBeans/apache-tomcat-8.0.15
29-Jan-2015 11:42:53.331 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/Users/Exceen/Library/Application Support/NetBeans/8.0.2/apache-tomcat-8.0.15.0_base/conf/logging.properties
29-Jan-2015 11:42:53.331 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
29-Jan-2015 11:42:53.331 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/Applications/NetBeans/apache-tomcat-8.0.15/endorsed
29-Jan-2015 11:42:53.331 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/Users/Exceen/Library/Application Support/NetBeans/8.0.2/apache-tomcat-8.0.15.0_base
29-Jan-2015 11:42:53.331 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/Applications/NetBeans/apache-tomcat-8.0.15
29-Jan-2015 11:42:53.331 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/Users/Exceen/Library/Application Support/NetBeans/8.0.2/apache-tomcat-8.0.15.0_base/temp
29-Jan-2015 11:42:53.332 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Applications/NetBeans/NetBeans 8.0.2.app/Contents/Resources/NetBeans/webcommon/bin::/Users/Exceen/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
29-Jan-2015 11:42:53.479 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
29-Jan-2015 11:42:53.503 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
29-Jan-2015 11:42:53.511 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
29-Jan-2015 11:42:53.513 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
29-Jan-2015 11:42:53.517 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 696 ms
29-Jan-2015 11:42:53.586 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
29-Jan-2015 11:42:53.586 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.15
29-Jan-2015 11:42:53.599 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor /Users/Exceen/Library/Application Support/NetBeans/8.0.2/apache-tomcat-8.0.15.0_base/conf/Catalina/localhost/manager.xml
29-Jan-2015 11:42:54.127 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars 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.
29-Jan-2015 11:42:54.196 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor /Users/Exceen/Library/Application Support/NetBeans/8.0.2/apache-tomcat-8.0.15.0_base/conf/Catalina/localhost/manager.xml has finished in 596 ms
29-Jan-2015 11:42:54.196 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor /Users/Exceen/Library/Application Support/NetBeans/8.0.2/apache-tomcat-8.0.15.0_base/conf/Catalina/localhost/ROOT.xml
29-Jan-2015 11:42:54.297 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars 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.
29-Jan-2015 11:42:54.299 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor /Users/Exceen/Library/Application Support/NetBeans/8.0.2/apache-tomcat-8.0.15.0_base/conf/Catalina/localhost/ROOT.xml has finished in 103 ms
29-Jan-2015 11:42:54.303 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
29-Jan-2015 11:42:54.310 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
29-Jan-2015 11:42:54.311 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 793 ms

有人能帮帮我吗?

ryoqjall

ryoqjall1#

我通过编辑server.xml并添加server="XXXXXXX"找到了修复方法,其中XXXXXXX应该与netbeans中的Web服务器名称相同。
例如,server="Apache Tomcat or TomEE"

yizd12fk

yizd12fk2#

检查您的Web浏览器,如果启动Tomcat后,您可以访问localhost(如果您没有更改端口号,它在:http://localhost:8080/)。
如果有效:- 应用程序-服务器通信有问题(你是否正确部署了你的应用程序?是否有防火墙,可能会阻止你的应用程序运行?)
如果不正确:Tomcat配置不正确。您可以尝试在Netbeans之外(例如在控制台)启动它,看看它是否工作。如果不正确,请重新安装Tomcat。

hvvq6cgz

hvvq6cgz3#

试试看:

  • 在Web浏览器地址栏中手动输入正确的Web应用程序路径。
  • 因为IDE不知道起始路径。或者您必须在web.xml中设置<welcome-files-list>元素。
juzqafwq

juzqafwq4#

我也有同样的问题,但这解决了问题:
嗨,我只是想指出一个观察结果。我发现在netbeans中启动tomee 1.7.2(plus)作为服务器,netbeans对8080连接器上的server ="Apache TomEE"配置不太满意。因此,通过删除这一启动再次确定。
我猜是netbeans tomee(和tomcat)扩展中的一个bug。
(创建于:http://tomee-openejb.979440.n4.nabble.com/netbeans-annoyance-td4675134.html

sg3maiej

sg3maiej5#

在我的Mac上发生过。
原因是网络更改=〉我在网络设置中设置了静态IP。

uplii1fm

uplii1fm6#

出现了相同症状的问题,结果是 Catalina _BASE/conf/localhost中缺少manager.xml,因此Tomcat的管理器应用程序无法启动,Netbeans无法与之对话。安装包含以下内容的manager.xml文件可修复该问题:

<Context docBase="${catalina.home}/webapps/manager" antiResourceLocking="false" privileged="true"/>
o2rvlv0m

o2rvlv0m7#

其他答案对我都没有帮助,而且也没有任何记录,所以我花了很大的力气在Java调试器中调试NetBeans,以找出问题所在。结果我发现NetBeans被拒绝与Tomcat Manager Web应用程序建立TCP套接字连接,这使它错误地认为Tomcat没有运行。
解决方案:

-J-Djava.net.preferIPv4Stack=true

添加到netbeans. conf文件中的命令行选项(关键字"netbeans_default_options")。
如果这样做仍然没有帮助,您可以在org.netbeans.modules.tomcat5.util.Utils#pingTomcat()中设置一个断点,并从那里跟踪发生的情况。

cgh8pdjw

cgh8pdjw8#

在我的Windows计算机中,我使用以下链接解决了该问题:
https://geekflare.com/tomcat-stuck-at-startup/

链接摘要:

1.转到Tomcat安装文件夹,然后转到bin
1.使用catalina.shvi编辑器打开www.example.com
1.搜索JAVA_OPTS并添加以下内容
-Djava.security.egd=文件:/dev/./urandom 4.保存文件并重新启动Tomcat

相关问题