1

我是一个新手,刚开始在 jsp 中工作,我安装了先决条件并在 Eclipse Juno 中创建了一个动态 Web 项目,为了测试配置是否运行良好,我创建了一个名为 index.jsp 的虚拟 jsp 页面和试图运行它。但我收到错误,详细信息如下:

    Jun 26, 2013 5:20:24 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Ruby200-x64\bin;C:\Python33\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin;C:\Program Files\Java\jdk1.7.0_21\bin;C:\Program Files\Java\jdk1.7.0_21\lib;C:\Program Files (x86)\Windows Live\Shared;.
Jun 26, 2013 5:20:24 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:DemoWebApp1' did not find a matching property.
Jun 26, 2013 5:20:24 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jun 26, 2013 5:20:24 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jun 26, 2013 5:20:24 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 755 ms
Jun 26, 2013 5:20:24 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jun 26, 2013 5:20:24 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.32
Jun 26, 2013 5:20:24 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jun 26, 2013 5:20:24 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jun 26, 2013 5:20:24 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 489 ms
Jun 26, 2013 5:20:24 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:8005]: 
java.net.BindException: Address already in use: JVM_Bind
    at java.net.DualStackPlainSocketImpl.bind0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
    at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
    at java.net.PlainSocketImpl.bind(Unknown Source)
    at java.net.ServerSocket.bind(Unknown Source)
    at java.net.ServerSocket.<init>(Unknown Source)
    at org.apache.catalina.core.StandardServer.await(StandardServer.java:427)
    at org.apache.catalina.startup.Catalina.await(Catalina.java:766)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:712)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:451)

Jun 26, 2013 5:20:24 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Jun 26, 2013 5:20:26 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Jun 26, 2013 5:20:27 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Jun 26, 2013 5:20:27 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Jun 26, 2013 5:20:28 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Jun 26, 2013 5:20:30 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Jun 26, 2013 5:20:30 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]

我无法弄清楚我做错了什么,或者我的系统中没有正确配置什么。提前谢谢 :) 我真的很想尽快开始学习 JSP,但这阻止了我。帮助!!

4

5 回答 5

1

首先,您应该尝试卸载tomcat并通过授予适当的权限重新安装它。它应该适合你。它对我有用。

于 2013-07-11T17:46:09.040 回答
1

以root权限重新安装eclipse和tomcat并重新配置IDE。

于 2013-07-23T18:59:15.050 回答
0

您已经有另一个进程正在运行,它占用了 8005 端口。

当您尝试启动 Tomcat 并且它已经启动时,这通常发生在 8005 上。由您在其他地方(另一个 Eclipse 调试会话)或在安装 Tomcat 时将 Tomcat 作为服务启动。

按照一般原则,当您想从 Eclipse 内部运行 Tomcat 时,不应使用安装程序来启动并运行它,而应使用 zip 文件。

如果您是 Java 编程的新手,我会建议使用 Netbeans(在卸载 Tomcat 之后)。他们的下载通常可以更好地开箱即用地进行 Web 开发。

于 2013-06-26T12:14:16.650 回答
0

该端口已被使用。您可以通过在此文件中更改端口 %CATALINA_HOME%\conf\server.xml 并再次运行程序来进行快速检查。

于 2013-06-26T12:16:49.373 回答
0

您应该使用 www.sysinternals.com 的 tcpview 找出哪个进程占用了 8005 端口。如果您无法摆脱该进程,您可以尝试在 Tomcats 中配置一个备用端口server.xml

于 2013-06-26T12:20:05.243 回答