我已经开始学习 Servlets,所以我从这里下载了 apache tomcat 7.x zip 文件(core--> zip) 。我将它解压缩到我的目录 (D:),然后我刚刚将JAVA_HOME
System 变量设置为值C:\Program Files\Java\jdk1.6.0
(我的计算机在windows 7 Home basic 上运行)。
我已经通过文件夹中的startup.bat文件启动了服务器bin
。当我尝试访问localhost:8080
时,它总是unable to connect
在浏览器上显示。所以我将端口号更改为9999
server.xml并重新启动它。它再次说无法在我的浏览器中连接。当我启动服务器时,它在命令外壳上显示以下内容。有人可以帮我解决这个问题并使我的服务器正常工作吗?
通过在命令 shell 上观察以下内容,我只能找到这行似乎给出了一些问题的迹象:Failed to initialize component [Standard Server[8005]]
. 还是不知道和连接不上有什么关系。。
Feb 24, 2013 4:58:02 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performanc
e in production environments was not found on the java.library.path: C:\Program
Files\Java\jdk1.6.0\bin;.;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\
Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\
Program Files\Java\jdk1.6.0\bin
Feb 24, 2013 4:58:02 PM org.apache.catalina.startup.Catalina load
SEVERE: Catalina.start
org.apache.catalina.LifecycleException: Failed to initialize component [Standard
Server[8005]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.startup.Catalina.load(Catalina.java:633)
at org.apache.catalina.startup.Catalina.load(Catalina.java:658)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.catalina.LifecycleException: Failed to initialize componen
t [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.j
ava:814)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 8 more
Caused by: org.apache.catalina.LifecycleException: Failed to initialize componen
t [StandardEngine[Catalina]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.core.StandardService.initInternal(StandardService
.java:544)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 10 more
Caused by: java.lang.NoSuchMethodError: java.util.concurrent.ThreadPoolExecutor.
allowCoreThreadTimeOut(Z)V
at org.apache.catalina.core.ContainerBase.initInternal(ContainerBase.jav
a:1083)
at org.apache.catalina.core.StandardEngine.initInternal(StandardEngine.j
ava:283)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 12 more
Feb 24, 2013 4:58:02 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 532 ms
Feb 24, 2013 4:58:02 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-9999"]
Feb 24, 2013 4:58:02 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Feb 24, 2013 4:58:02 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Feb 24, 2013 4:58:03 PM org.apache.catalina.startup.Catalina start
SEVERE: Catalina.start:
org.apache.catalina.LifecycleException: Failed to stop component [StandardServer
[8005]]
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:141)
at org.apache.catalina.startup.Catalina.start(Catalina.java:684)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)
Caused by: org.apache.catalina.LifecycleException: An invalid Lifecycle transiti
on was attempted ([before_stop]) for component [org.apache.catalina.deploy.Namin
gResources@1807ca8] in state [INITIALIZED]
at org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBas
e.java:409)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:219)
at org.apache.catalina.core.StandardServer.stopInternal(StandardServer.j
ava:756)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
... 8 more
Feb 24, 2013 4:58:03 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 11 ms