Link to home
Start Free TrialLog in
Avatar of bowemc
bowemc

asked on

Port 8888 alreay in use

hi,

I was running tomcat on port 8888. I'm not sure what happened but all of a sudden tomcat seemed to crash as none of the application worked. When I tried to restart tomcat server it said port 8888 was already in use. I've tried altering the port in server.xml to port 8887 - the server starts and my (jsp) wiki works, but editing pages seems to hang and this worked fine before.

any ideas how I can free port 8888 so I can restart as was, or resolve the editing page issue?

thanks
Avatar of giltjr
giltjr
Flag of United States of America image

What OS?

If windows you can do:

     netstat -ano | findstr /c:"8888" | findstr /c:"LIST"

For Linux:

    netstat -anp | grep 8888 | grep LIST

This will show you the process id that has the port open, kill that task and you should be fine.
sounds like your app dies but tomcat is still running
check the process/task list to see if it is running and kill it
Avatar of bowemc
bowemc

ASKER

No tomcat is deat. When I try to restart it on port 8888 I get
Apr 6, 2010 6:47:23 PM org.apache.coyote.http11.Http11Protocol init
SEVERE: Error initializing endpoint
java.net.BindException: Address already in use:8888
        at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:501)
        at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:177)
        at org.apache.catalina.connector.Connector.initialize(Connector.java:1059)
        at org.apache.catalina.core.StandardService.initialize(StandardService.java:677)
        at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:792)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:518)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
Apr 6, 2010 6:47:23 PM org.apache.catalina.startup.Catalina load
SEVERE: Catalina.start
LifecycleException:  Protocol handler initialization failed: java.net.BindException: Address already in use:8888
        at org.apache.catalina.connector.Connector.initialize(Connector.java:1061)
        at org.apache.catalina.core.StandardService.initialize(StandardService.java:677)
        at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:792)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:518)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)

Did you do the netstat command to see what is listening on port 8888?
> No tomcat is deat. When I try to restart it on port 8888 I get

What makes you think that
Have you checked the process list?

> java.net.BindException: Address already in use:8888

That suggests it is still running
Avatar of bowemc

ASKER

Hi

giltgr -

bash-3.00$  netstat -anp | grep 8888 | grep LIST
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 :::8888                     :::*                        LISTEN      2551/java


objects -

1) bash-3.00$ ps | grep apache
bash-3.00$

"ps | grep apache" or even "ps" doesn't return anythin so I don't think it's running....

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Actually if you had done what I originally posted, which was to do the netstat command to get the process id and then kill it.  In this situation the process id was 2551.  If you had done:

     ps | grep 2551

you would have seen the process name was java.  You would have killed 2551 and then tomcat would have really been down.