无法启动Tomcat

时间:2015-02-17 08:51:27

标签: java tomcat netbeans

我正在尝试在Netbeans中启动Tomcat,不幸的是它停留在“org.apache.catalina.startup.Catalina.start服务器启动时间为793 ms”。过了一会儿,我收到一条错误消息弹出窗口,说启动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

有人可以帮帮我吗?

6 个答案:

答案 0 :(得分:2)

我通过修改server.xml并添加server="XXXXXXX"找到了此修复程序,其中XXXXXXX应与netbeans中的网络服务器名称相同。

例如,server="Apache Tomcat or TomEE"

答案 1 :(得分:1)

检查您的网络浏览器,如果在启动tomcat后您可以访问localhost(如果您还没有更改端口号,则在http://localhost:8080/下)。

如果有效: - 应用程序 - 服务器通信存在问题(您是否正确部署了应用程序?是否存在可能阻止您的应用程序运行的防火墙?)

如果没有: Tomcat配置不正确。您可能会尝试在Netbeans外部启动它(例如在控制台中)以查看它是否有效。如果没有,请重新安装Tomcat。

答案 2 :(得分:0)

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

答案 3 :(得分:0)

我有同样的问题,但这解决了这个问题:

  

嗨,我只是想指出一个观察。我发现了   从netbeans开始到1.7.2(加)作为服务器,netbeans不是   太高兴关于8080上的server =“Apache TomEE”配置   连接器。所以通过删除这一个启动再次确定。

     

我猜netbeans tomee(和tomcat)扩展中的一个错误。

(在此成立:http://tomee-openejb.979440.n4.nabble.com/netbeans-annoyance-td4675134.html

答案 4 :(得分:0)

在我的Mac上发生在我身上。

原因是网络变化=&gt;我在网络设置上设置静态IP。

答案 5 :(得分:0)

没有其他答案对我有帮助,也没有任何记录,因此我走了很长一段路,在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()中设置一个断点,并跟踪在那里发生的事情。