The actual application consists out of two different Grails applications. To run both Grails applications at the same time on our local machines we configured two different application ports. The first application (let's call it App1) was running on Port 8081 while App2 (the second application) was running on Port 8082.
Now we faced the following effects:
- If App2 was started before App1 everything worked fine. However, if App1 was started first, then App2 would not start and show a "Port is already in use" error instead. What?!
- App1 contains links that point to App2. For our local environment these links look like http://localhost:8082/app2/someController. If App2 was not started at all and someone clicked one of these links App1 stopped working. What?!
So whenever we started App1 first the kill switch was listening at port 8082 (and therefore we were not able to start App2). Clicking any link that points to App2 triggered the kill switch and the embedded Tomcat of App1 shuts down. If we started App2 first the server socket of the kill switch failed silently on startup of App1 and everything worked as expected. Changing the port of App2 from 8082 to 8083 solved the problem.
Share this post using Facebook, Twitter or Google+