2 w0shi1 w0shi1 于 2013.07.22 09:39 提问

在eclipse中运行HelloServlet.java,出现404

tomcat显示已经启动了,但为什么出现404,http://localhost:8080页面也打不开,
错误信息为
七月 22, 2013 9:32:57 上午 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:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;D:\app\Administrator\product\11.1.0\db_1\bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;D:\Program Files\Java\jdk1.7.0_01\bin;;E:\eclipse;;.
七月 22, 2013 9:32:57 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Test123' did not find a matching property.
七月 22, 2013 9:32:57 上午 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
七月 22, 2013 9:32:57 上午 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
七月 22, 2013 9:32:57 上午 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 989 ms
七月 22, 2013 9:32:57 上午 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
七月 22, 2013 9:32:57 上午 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
七月 22, 2013 9:32:58 上午 org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [109] milliseconds.
七月 22, 2013 9:32:58 上午 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
七月 22, 2013 9:32:58 上午 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
七月 22, 2013 9:32:58 上午 org.apache.catalina.startup.Catalina start
INFO: Server startup in 724 ms
七月 22, 2013 9:33:36 上午 org.apache.catalina.core.StandardServer await
INFO: A valid shutdown command was received via the shutdown port. Stopping the Server instance.
七月 22, 2013 9:33:36 上午 org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
七月 22, 2013 9:33:36 上午 org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
七月 22, 2013 9:33:36 上午 org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
七月 22, 2013 9:33:37 上午 org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
七月 22, 2013 9:33:37 上午 org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
七月 22, 2013 9:33:37 上午 org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
七月 22, 2013 9:33:37 上午 org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]

2个回答

u010212328
u010212328   2013.07.22 10:31
已采纳

在控制台双击Servers,你看把Server Locations 选择第二个,再把Server Options改成pwebapps行不行。我那天也遇到了。 不知道问题是不是一样的,我反正是初学的。

u011284446
u011284446   2013.07.22 09:47

属性source没设置好,你看看是不是

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!