I hosted a server in eclipse by tomcat but cant access localhost:8080 or my jsp page from browser

StackOverflow https://stackoverflow.com/questions/23185181

  •  06-07-2023
  •  | 
  •  

Question

So I am a complete newbie in using tomcat and servers and jsp. Just trying to open a webapp made by someone else but I cant set up the server... below are what i've done to try to solve the problem:

  1. I can open localhost:8080 if I run the server from Configure Tomcat (not in eclipse)

  2. I've checked server.xml file and the localhost is indeed 8080

  3. I've set the server location to use tomcat installation in eclipse enter image description here

  4. I can run the server in eclipse, it appears fine but I just cannot open the localhost:8080 page from browser. - the error says something like Chrome failed to access localhost:8080 and i back to eclipse page it would show that the server is "[starting, synchronized]".

  5. BUT If i try to open my web app from browser like http://localhost:8080/my-app-name it would show the error the connection to localhost is stopped - and when I back to eclipse the server was "[stopped, synchronized]".

  6. I cannot access either localhost:8080 or 120.0.0.1.

and below is the log files appear in my console when i am starting up the server within eclipse:(ignore the chinese, they re irrelevant)

4月 21, 2014 1:24:08 上午 org.apache.catalina.core.AprLifecycleListener init
資訊: 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\jdk1.7.0_13\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;c:/Program Files/Java/jdk1.7.0_13/bin/../jre/bin/server;c:/Program Files/Java/jdk1.7.0_13/bin/../jre/bin;c:/Program Files/Java/jdk1.7.0_13/bin/../jre/lib/amd64;c:\Program Files\Java\jdk1.7.0_13\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32\wbem;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Ruby193\bin;C:\Program Files\SciTools/bin/pc-win64;C:\Users\kimlu\Downloads\eclipse;;.
4月 21, 2014 1:24:08 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:a_small_book_db' did not find a matching property.
4月 21, 2014 1:24:09 上午 org.apache.coyote.AbstractProtocolHandler init
資訊: Initializing ProtocolHandler ["http-bio-8080"]
4月 21, 2014 1:24:09 上午 org.apache.coyote.AbstractProtocolHandler init
資訊: Initializing ProtocolHandler ["ajp-bio-8009"]
4月 21, 2014 1:24:09 上午 org.apache.catalina.startup.Catalina load
資訊: Initialization processed in 2558 ms
4月 21, 2014 1:24:09 上午 org.apache.catalina.core.StandardService startInternal
資訊: Starting service Catalina
4月 21, 2014 1:24:09 上午 org.apache.catalina.core.StandardEngine startInternal
資訊: Starting Servlet Engine: Apache Tomcat/7.0.12
4月 21, 2014 1:24:10 上午 org.apache.catalina.util.SessionIdGenerator createSecureRandom
資訊: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [101] milliseconds.
4月 21, 2014 1:24:10 上午 org.apache.catalina.startup.HostConfig deployDirectory
資訊: Deploying web application directory docs
4月 21, 2014 1:24:11 上午 org.apache.catalina.startup.HostConfig deployDirectory
資訊: Deploying web application directory examples
4月 21, 2014 1:24:11 上午 org.apache.catalina.core.ApplicationContext log
資訊: ContextListener: contextInitialized()
4月 21, 2014 1:24:12 上午 org.apache.catalina.core.ApplicationContext log
資訊: SessionListener: contextInitialized()
4月 21, 2014 1:24:12 上午 org.apache.catalina.startup.HostConfig deployDirectory
資訊: Deploying web application directory host-manager
4月 21, 2014 1:24:12 上午 org.apache.catalina.startup.HostConfig deployDirectory
資訊: Deploying web application directory manager
4月 21, 2014 1:24:12 上午 org.apache.catalina.startup.HostConfig deployDirectory
資訊: Deploying web application directory ROOT
4月 21, 2014 1:24:12 上午 org.apache.coyote.AbstractProtocolHandler start
資訊: Starting ProtocolHandler ["http-bio-8080"]
4月 21, 2014 1:24:12 上午 org.apache.coyote.AbstractProtocolHandler start
資訊: Starting ProtocolHandler ["ajp-bio-8009"]
4月 21, 2014 1:24:12 上午 org.apache.catalina.startup.Catalina start
資訊: Server startup in 3174 ms

My browser is not in english so i cannot tell what exactly the error message was! But it should be very close to what i stated above. Please help! thanks in advance:)

Was it helpful?

Solution

Granted I'm swinging in the dark here, but you try localhost:8005 to see if the admin port works yet? or just 8080?

Are there logfiles that you can view? Looks like you get the server up and listening, when something tries to connect that's when the port closing?

First step that I would try is change the port to something else other than the one for web traffic see if that resolved it. Best of luck though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top