Hello @all,
we were using tomcat-maven-plugin which uses Tomcat 6 until last week to run our API written in Java and to test around with it. This worked very well for ages and we got used to it but now we decided to switch to tomcat7-maven-plugin.

We used the Jersey Java Framework to build our API. When we wanted to "redeploy" we stopped the running "mvn tomcat:run" process in our console and started it again after pulling the new code via git. After a while the API grew bigger and it took a lot of time to prepare the start of the API (caching, etc) - up to 10min. So we decided to start up the new version of the API in a separate console window (we use byobu on our server) and define in our contextInitialized()-Method right before it returns a special command to the Linux system to kill the old API process. After the old API was killed the contextInitialized()-Method returned and the new version of the API started at the desired port.

Now after the switch to tomcat7 this procedure doesn't work any more. The problem is, that the tomcat7 get hold of the desired port very early:

[INFO] --- tomcat7-maven-plugin:2.2:run (default-cli) @ core ---
[INFO] Running war on http://localhost:8686/
[INFO] Creating Tomcat server configuration at /opt/dev/target/tomcat
[INFO] create webapp with contextPath:
Feb 03, 2016 2:50:14 PM org.apache.coyote.AbstractProtocol init
INFORMATION: Initializing ProtocolHandler ["http-bio-8686"]
Feb 03, 2016 2:50:14 PM org.apache.coyote.AbstractProtocol init
SCHWERWIEGEND: Failed to initialize end point associated with ProtocolHandler ["http-bio-8686"]
java.net.BindException: Die Adresse wird bereits verwendet <null>:8686
at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:407) at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:623)


So my question is right now: why is Tomcat 6 grabbing the port very late, after contextInitialized() is done, and Tomcat 7 is doing this so early? Is there a configuration method to let Tomcat 7 start the port after contextInitialized() is done?

Thank you for your help,
best
Simon

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to