facebook

Tomcat restart error vs. manual stop and start

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #257879 Reply

    Paul
    Participant

    Been using ME for quite awhile, never really having any issues with Tomcat start/stop from Eclipse. I recently did a fresh install of Eclipse/ME 5.0.1, and JDK 1.5.08, and seem to be having a minor issue when pressing the ‘restart’ button for Tomcat. Quite often when pressing this button I see the server stopping in the console, and upon restart I see a BindException because the address is already in use:

    2006-08-30 17:48:41,676 : Error initializing endpoint 
    java.net.BindException: Address already in use:8080
        at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:297)
        at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:142)
        at org.apache.catalina.connector.Connector.initialize(Connector.java:928)
        at org.apache.catalina.core.StandardService.initialize(StandardService.java:580)
        at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:764)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:490)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:509)
        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:585)
        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:243)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:408)
    2006-08-30 17:48:41,685 : Catalina.start 
    LifecycleException:  Protocol handler initialization failed: java.net.BindException: Address already in use:8080
        at org.apache.catalina.connector.Connector.initialize(Connector.java:930)
        at org.apache.catalina.core.StandardService.initialize(StandardService.java:580)
        at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:764)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:490)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:509)
        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:585)
        at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:243)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:408)
    2006-08-30 17:48:41,686 : Initialization processed in 1650 ms 
    2006-08-30 17:48:42,188 : Starting service Catalina 
    2006-08-30 17:48:42,216 : Starting Servlet Engine: Apache Tomcat/5.5.9 
    2006-08-30 17:48:42,259 : XML validation disabled 
    2006-08-30 17:49:02,304 : Starting Coyote HTTP/1.1 on http-8080 
    2006-08-30 17:49:03,589 : Initializing Coyote HTTP/1.1 on http-8443 
    2006-08-30 17:49:03,602 : Starting Coyote HTTP/1.1 on http-8443 
    2006-08-30 17:49:03,847 : JK: ajp13 listening on /0.0.0.0:8009 
    2006-08-30 17:49:04,002 : Jk running ID=0 time=0/213  config=null 
    2006-08-30 17:49:04,220 : Find registry server-registry.xml at classpath resource 
    2006-08-30 17:49:04,787 : Server startup in 23101 ms 
    

    It looks likeTomcat hasn’t fully shut down when ME tries to start a new instance. If I manually stop Tomcat, and then manually start it – works everytime (the only exceptions then are because of something I did in my code).

    System config details below (Linux, Eclipse 3.2, ME 5.01, Sun JDK 1.5.08)

    *** Date: Wed Aug 30 17:57:17 PDT 2006

    *** Platform Details:

    *** System properties:
    GRE_HOME=/home/paul/data/development/MyEclipse5.0.1/eclipse/plugins/com.genuitec.javascript.debug.mozilla_5.0.1/XPCOM/os/linux/mozilla
    eclipse.buildId=M20060629-1905
    eclipse.commands=-os
    linux
    -ws
    gtk
    -arch
    x86
    -launcher
    /home/paul/data/development/eclipse/./eclipse
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    a8002
    -vm
    /usr/bin/java
    eclipse.ee.install.verify=false
    eclipse.product=org.eclipse.sdk.ide
    eclipse.startTime=1156981140916
    eclipse.vm=/usr/bin/java
    eclipse.vmargs=-Xms256M
    -Xmx320M
    -XX:PermSize=96M
    -XX:MaxPermSize=128M
    -jar
    /home/paul/data/development/eclipse/./startup.jar
    eof=eof
    file.encoding=UTF-8
    file.encoding.pkg=sun.io
    file.separator=/
    java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
    java.awt.printerjob=sun.print.PSPrinterJob
    java.class.path=/home/paul/data/development/eclipse/./startup.jar
    java.class.version=49.0
    java.endorsed.dirs=/usr/lib/j2sdk1.5-sun/jre/lib/endorsed
    java.ext.dirs=/usr/lib/j2sdk1.5-sun/jre/lib/ext
    java.home=/usr/lib/j2sdk1.5-sun/jre
    java.io.tmpdir=/tmp
    java.library.path=/usr/lib/j2sdk1.5-sun/jre/lib/i386/client:/usr/lib/j2sdk1.5-sun/jre/lib/i386:/usr/lib/j2sdk1.5-sun/jre/../lib/i386:
    java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition
    java.runtime.version=1.5.0_08-b03
    java.specification.name=Java Platform API Specification
    java.specification.vendor=Sun Microsystems Inc.
    java.specification.version=1.5
    java.vendor=Sun Microsystems Inc.
    java.vendor.url=http://java.sun.com/
    java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi
    java.version=1.5.0_08
    java.vm.info=mixed mode, sharing
    java.vm.name=Java HotSpot(TM) Client VM
    java.vm.specification.name=Java Virtual Machine Specification
    java.vm.specification.vendor=Sun Microsystems Inc.
    java.vm.specification.version=1.0
    java.vm.vendor=Sun Microsystems Inc.
    java.vm.version=1.5.0_08-b03

    Thanks,

    Paul

    #257919 Reply

    Scott Resnik
    Member

    I’ve noticed that issue, and occasionally I also get a dialog saying that tomcat cannot be started because of a configuration error when I restart vs. stopping and starting. This is with ME 5.0.1, and Eclipse 3.2.

    #258374 Reply

    innogate
    Member

    +1

    The problem may be that since ME 5.0.1 a server stop really tries to shutdown the server in a clean way instead of just killing the process, like previous versions did (which is a good improvement).

    Unfortunately the time of the new server’s start wasn’t adjusted to this improvement.

    #259713 Reply

    Riyad Kalla
    Member

    Guys the way th connector is coded now is to try a clean shut down for up to 10 seconds, if the process takes longer than that, it’s killed (like the old way) and then you can spin a new one back up.

    pwoods, how long does Tomcat take to startup and shut down if you do it manually? I wonder if the connector isn’t really killing the process like it should.

    #259805 Reply

    Paul
    Participant

    @support-rkalla wrote:

    pwoods, how long does Tomcat take to startup and shut down if you do it manually? I wonder if the connector isn’t really killing the process like it should.

    Depending on the apps I have loaded, can be anywhere from 8 to 20 seconds typically to startup. Shutdown appears to be much quicker, about 2 or 3 seconds I’m guessing on average.

    For a restart, it is supposed to wait for ten seconds on shutdown before attempting to startup again? When I click Restart the console shows the shutdown process, and the startup process starts *immediately* after that – from the start of shutdown to the beginning of startup might take 3 seconds.

    Another note – to hijack my own thread here. I just upgraded to the originally posted setup w/ Eclipse 3.2.1, and in Window-Preferences-My Eclipse-Application Servers, the text displayed is truncated. The ‘Note’ ends at the second sentence with “All configuration information is”. In addition, there should (or used to be) a drop down list for the different connectors that ship with ME, for each server type, and this list is no longer present.

    Thanks,

    Paul

    #259877 Reply

    Riyad Kalla
    Member

    For a restart, it is supposed to wait for ten seconds on shutdown before attempting to startup again? When I click Restart the console shows the shutdown process, and the startup process starts *immediately* after that – from the start of shutdown to the beginning of startup might take 3 seconds.

    That’s the correct behavior, I was just saying that it will give at most 10 seconds time for the app server to shut down before it nukes it, but if it shuts down faster that is fine. If you keep hitting the restart button for the app server, how frequently can you reproduce the restart problem? 1/2 the time? 1/4 the time?

    Another note – to hijack my own thread here. I just upgraded to the originally posted setup w/ Eclipse 3.2.1, and in Window-Preferences-My Eclipse-Application Servers, the text displayed is truncated. The ‘Note’ ends at the second sentence with “All configuration information is”. In addition, there should (or used to be) a drop down list for the different connectors that ship with ME, for each server type, and this list is no longer present.

    We are going to be developing/testing MyEclipse 5.0.3 against Eclipse 3.2.1, so don’t upgrade just yet. (I know, in theory it shouldn’t matter… but when has theory worked with software development? 🙂

    #260051 Reply

    Paul
    Participant

    @support-rkalla wrote:

    If you keep hitting the restart button for the app server, how frequently can you reproduce the restart problem? 1/2 the time? 1/4 the time?

    If I just hit the restart button, or do some simple edits of JSP or XML files and restart, it seems to be fine. Only when I do some actual work does it have problems. Sorry I can’t quantify it better, I could be here all night trying to. Let me know if you need more.

    Thanks,

    Paul

    #260092 Reply

    Riyad Kalla
    Member

    Paul,
    I’ll ask the connector developer to look at his code a little more closely to see if he can catch any edge cases (like you hitting restart AS the context is reload could cause it to barf).

    #260616 Reply

    sixel
    Member

    Hi all,

    I upgraded last week both Eclipse (3.1.x to 3.2.1) and MyEclipse (4.x to 5.0.1).
    I have the very same problem when I hit the restart button : Tomcat’s process is not shutdown nor killed, and another instance is started, raising this BindException.

    Here’s the exception I get in the console of the “first” Tomcat (the one that’s supposed to be shutdown) :

    
    org.apache.coyote.http11.Http11BaseProtocol destroy
    INFO: Stopping Coyote HTTP/1.1 on http-8080
    org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    INFO: Failed shutdown of Apache Portable Runtime
    

    Note that this happens even without any webapp loaded, and in my case, it occurs any time I try to restart Tomcat.

    Hope this helps to solve the bug, and thanks for the great product!

    alexis

    #260623 Reply

    Riyad Kalla
    Member

    Alexis,
    That message is actually a successful shutdown. The Apache Portable Runtime is an additional resource you can setup in Tomcat that is not enabled out of the box by default, so shutdown fails for it. You can verify this by launching Tomcat from the command line then shutting it down, the same thing happens.

    As far as the bindexception, that definitely shouldn’t be happening. Does this happen every single time, or only someitmes when using the restart behavior?

    #260625 Reply

    sixel
    Member

    The BindException happens any single time I hit the restart button, no matter how many webapps are loaded (even with none), no matter I run Tomcat in debug or run mode (I didn’t know if this should change something for this behaviour, but I thought it would be worth to give it a try).

    If you have any idea for a workaround, it would be most welcome 🙂

    #260627 Reply

    Riyad Kalla
    Member

    Alexis,
    Can you go to MyEclipse > Installation Summary > Installation Details and post your info here? Also let me know which version of Tomcat, I’ll try and reproduce it locally.

    #260629 Reply

    sixel
    Member

    The tomcat version is 5.5.17.

    Here are the ME install details :

    *** Date: Wed Oct 18 16:26:44 CEST 2006

    *** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.5.0_06

    *** MyEclipse details:
    MyEclipse Enterprise Workbench

    Version: 5.0 GA
    Build id: 20060805-5.0-GA

    *** Eclipse details:
    Eclipse SDK

    Version: 3.2.1
    Build id: M20060921-0945

    Eclipse Platform

    Version: 3.2.1.r321_v20060921-b_XVA-INSQSyMtx
    Build id: M20060629-1905

    Eclipse RCP

    Version: 3.2.1.r321_v20060801-2ekW2BxmcpPUOoq
    Build id: M20060629-1905

    Eclipse Java Development Tools

    Version: 3.2.1.r321_v20060905-R4CM1Znkvre9wC-
    Build id: M20060921-0945

    Eclipse Plug-in Development Environment

    Version: 3.2.1.r321_v20060823-6vYLLdQ3Nk8DrFG
    Build id: M20060921-0945

    Eclipse Project SDK

    Version: 3.2.1.r321_v20060801-tQ1w49KnTArT0FZ
    Build id: M20060921-0945

    Eclipse Graphical Editing Framework

    Version: 3.2.0.v20060626
    Build id: 20060627-0816

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\Archivos de programa\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    cdc_4c
    -vm
    C:\WINDOWS\system32\javaw.exe

    #260632 Reply

    Riyad Kalla
    Member

    Hmm, the 3.2.1 Eclipse version could be the culprit. There are a few minor known issues when running MyEclipse 5.0.1 on Eclipse 3.2.1, it seems they might have changed some behaviors in the APIs.

    We are working on our 5.0.3 release right now that is going to bring to the table a whole slew of bug fixes and enhancements (minor spit and polish, but lots of fixes) and I’ll test ot make sure this is working with that release.

    It’s due out Nov 6th.

    #260684 Reply

    sixel
    Member

    Thanks a lot for that quick support.

    I can wait until the next ME release, this bug, even if really annoying, is not really a stopper and once you know how to live with it, it’s ok : stop the Tomcat process by hitting the Terminate button in the console, and hit the restart button. It works just fine like that, and it’s just one more click than the optimal solution.

    Cheers,
    alexis

Viewing 15 posts - 1 through 15 (of 25 total)
Reply To: Tomcat restart error vs. manual stop and start

You must be logged in to post in the forum log in