File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes HTTP Status 404 - am I on the right port: 8080? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "HTTP Status 404 - am I on the right port: 8080?" Watch "HTTP Status 404 - am I on the right port: 8080?" New topic
Author

HTTP Status 404 - am I on the right port: 8080?

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
For some reason, don't know why, I'm running my ANT script and below is the message I get.

When I try to view the URL at: http://localhost:8080/OnlineRegistration/

I get the unpleasant message:

HTTP Status 404 - /OnlineRegistration/
type Status report
message /OnlineRegistration/
description The requested resource (/OnlineRegistration/) is not available.

Does anyone have any idea what's wrong? The ant script has been working great in the past 3 months!

Also, when I manually copy-pate the entire directory from my dev folder to the webbapps - it works ok (!?!?!?!)

Anyone?





Buildfile: C:\eclipseProjects\OnlineRegistration\build.xml
clean:
[delete] Deleting directory C:\eclipseProjects\OnlineRegistration\build\share
[delete] Deleting directory C:\eclipseProjects\OnlineRegistration\dist
[mkdir] Created dir: C:\eclipseProjects\OnlineRegistration\build\share
[mkdir] Created dir: C:\eclipseProjects\OnlineRegistration\dist
[echo] Apache Ant version 1.6.5 compiled on June 2 2005
[echo] Java version 1.5
compile-domain:
[javac] Compiling 22 source files to C:\eclipseProjects\OnlineRegistration\build\share
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: C:\eclipseProjects\OnlineRegistration\WEB-INF\src\com\struts\security\StartupManager.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
build-war:
[war] Building war: C:\eclipseProjects\OnlineRegistration\dist\OnlineRegistration.war
deploy:
[copy] Copying 1 file to C:\Tomcat\webapps\OnlineRegistration
reload:
[reload] OK - Reloaded application at context path /OnlineRegistration
tomcat-start-debug:
[echo] debug mode...
[java] Listening for transport dt_socket at address: 8000
[java] Oct 15, 2006 11:44:28 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
[java] INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.5.0_06\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\Common Files\Roxio Shared\DLLShared\;;C:\Program Files\MySQL\MySQL Server 5.0\bin;C:\Tomcat\common\lib\servlet-api.jar;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\QuickTime\QTSystem\;C:\Sun\AppServer\bin;C:\_download\SSH\_afterSetup;
[java] Oct 15, 2006 11:44:28 AM org.apache.coyote.http11.Http11BaseProtocol init
[java] SEVERE: Error initializing endpoint
[java] java.net.BindException: Address already in use: JVM_Bind:8080
[java] at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:297)
[java] at org.apache.coyote.http11.Http11BaseProtocol.init(Http11BaseProtocol.java:138)
[java] at org.apache.catalina.connector.Connector.initialize(Connector.java:1016)
[java] at org.apache.catalina.core.StandardService.initialize(StandardService.java:580)
[java] at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:791)
[java] at org.apache.catalina.startup.Catalina.load(Catalina.java:503)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[java] at java.lang.reflect.Method.invoke(Unknown Source)
[java] at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:266)
[java] at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
[java] Oct 15, 2006 11:44:28 AM org.apache.catalina.startup.Catalina load
[java] SEVERE: Catalina.start
[java] LifecycleException: Protocol handler initialization failed: java.net.BindException: Address already in use: JVM_Bind:8080
[java] at org.apache.catalina.connector.Connector.initialize(Connector.java:1018)
[java] at org.apache.catalina.core.StandardService.initialize(StandardService.java:580)
[java] at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:791)
[java] at org.apache.catalina.startup.Catalina.load(Catalina.java:503)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[java] at java.lang.reflect.Method.invoke(Unknown Source)
[java] at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:266)
[java] at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
[java] Oct 15, 2006 11:44:28 AM org.apache.catalina.startup.Catalina load
[java] INFO: Initialization processed in 1140 ms
[java] Oct 15, 2006 11:44:28 AM org.apache.catalina.core.StandardService start
[java] INFO: Starting service Catalina
[java] Oct 15, 2006 11:44:28 AM org.apache.catalina.core.StandardEngine start
[java] INFO: Starting Servlet Engine: Apache Tomcat/5.5.17
[java] Oct 15, 2006 11:44:28 AM org.apache.catalina.core.StandardHost start
[java] INFO: XML validation disabled
[java] Oct 15, 2006 11:44:29 AM org.apache.catalina.core.ApplicationContext log
[java] INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: ,]http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: ,]http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: ]]http://jakarta.apache.org]]
[java] Oct 15, 2006 11:44:29 AM org.apache.catalina.core.ApplicationContext log
[java] INFO: ContextListener: contextInitialized()
[java] Oct 15, 2006 11:44:29 AM org.apache.catalina.core.ApplicationContext log
[java] INFO: SessionListener: contextInitialized()
[java] log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
[java] log4j:WARN Please initialize the log4j system properly.
[java] Oct 15, 2006 11:44:31 AM org.apache.catalina.core.ApplicationContext log
[java] INFO: ContextListener: contextInitialized()
[java] Oct 15, 2006 11:44:31 AM org.apache.catalina.core.ApplicationContext log
[java] INFO: SessionListener: contextInitialized()
[java] log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
[java] log4j:WARN Please initialize the log4j system properly.
[java] Oct 15, 2006 11:44:31 AM org.apache.coyote.http11.Http11BaseProtocol start
[java] SEVERE: Error starting endpoint
[java] java.net.BindException: Address already in use: JVM_Bind:8080
[java] at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:297)
[java] at org.apache.tomcat.util.net.PoolTcpEndpoint.startEndpoint(PoolTcpEndpoint.java:312)
[java] at org.apache.coyote.http11.Http11BaseProtocol.start(Http11BaseProtocol.java:150)
[java] at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:75)
[java] at org.apache.catalina.connector.Connector.start(Connector.java:1089)
[java] at org.apache.catalina.core.StandardService.start(StandardService.java:459)
[java] at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
[java] at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[java] at java.lang.reflect.Method.invoke(Unknown Source)
[java] at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
[java] at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
[java] Oct 15, 2006 11:44:31 AM org.apache.catalina.startup.Catalina start
[java] SEVERE: Catalina.start:
[java] LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: java.net.BindException: Address already in use: JVM_Bind:8080
[java] at org.apache.catalina.connector.Connector.start(Connector.java:1096)
[java] at org.apache.catalina.core.StandardService.start(StandardService.java:459)
[java] at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
[java] at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[java] at java.lang.reflect.Method.invoke(Unknown Source)
[java] at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
[java] at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
[java] Oct 15, 2006 11:44:31 AM org.apache.catalina.startup.Catalina start
[java] INFO: Server startup in 3453 ms
[java] Oct 15, 2006 11:44:31 AM org.apache.catalina.core.StandardServer await
[java] SEVERE: StandardServer.await: create[8005]:
[java] java.net.BindException: Address already in use: JVM_Bind
[java] at java.net.PlainSocketImpl.socketBind(Native Method)
[java] at java.net.PlainSocketImpl.bind(Unknown Source)
[java] at java.net.ServerSocket.bind(Unknown Source)
[java] at java.net.ServerSocket.<init>(Unknown Source)
[java] at org.apache.catalina.core.StandardServer.await(StandardServer.java:372)
[java] at org.apache.catalina.startup.Catalina.await(Catalina.java:615)
[java] at org.apache.catalina.startup.Catalina.start(Catalina.java:575)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[java] at java.lang.reflect.Method.invoke(Unknown Source)
[java] at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
[java] at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
[java] Java Result: 1
BUILD SUCCESSFUL
Total time: 13 seconds
[ October 15, 2006: Message edited by: Bear Bibeault ]
Dan Gun
Greenhorn

Joined: Aug 06, 2003
Posts: 26
From your log information:


[java] SEVERE: Error initializing endpoint
[java] java.net.BindException: Address already in use: JVM_Bind:8080


Something else is using that port (8080).


SCJP 1.4
Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
I checked everything (I even replaced the port to 7070) nothing...same err message.

the odd thing is this:
I'm using eclipse and when i run tomcat and my ant script, it produce the war file and place it on the webapps. I GET THE ERR MESSAGE: http 404. now, when I run tomcat from windows (icon next to clock) the war works perfectly!

what is the problem, why can't i use it from eclipse?
Dan Gun
Greenhorn

Joined: Aug 06, 2003
Posts: 26
I'm not sure but it could be that Ant tried to re-start Tomcat while it is actually has been running.

Generally I'm happier to separate my build and deployment into different processes, as that will happen on the real world when your application is delivered to production.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: HTTP Status 404 - am I on the right port: 8080?
 
Similar Threads
debugging with ANT
404 error when application is runned on tomcat server.
A problem in Tomcat 6.0.20 startup on Windows Vista.
Apache Tomcat 6.0 for Windows error
TomCat is not starting