How to stop Eclipse from accumulating Tomcat instances each time one is restarted? - eclipse

I'm running Tomcat 8.5 in Eclipse 2019.3:
Every time I restart a Tomcat instance by clicking the green circle/triangle button, I end up with duplicate instances running:
How can I stop this from happening?
Here's some things I've already tried:
I tried upgrading to tomcat 9.0, it didn't help. This is the reason you see a couple of 9.0 configurations in a Stopped state.
I tried splitting up my application into two smaller apps, it didn't help. This is the reason you see two different Tomcat configurations of each version.

This turned out to be a coding issue! Once a Servlet Filter responsible for logging was removed, the problem went away. I presume that the Servlet Filter created a non-daemon thread that prevented termination of Tomcat, but I didn't dig deeper to confirm.

Related

Redeploying web-app on tomcat container fails because of web.xml missing even though its present in the war

Environment
JDK 1.8
Tomcat 7.0.55
A spring web app
Chef scripts for deploying
What's the issue
The application is deployed via chef and most of the times everything is fine. Except for 1 in 10 times or so the web.xml (under appbase webapps/myapp/WEB-INF/web.xml) goes missing during redeployment which causes the application not to start up.
This symptom disappears in eventual chef-runs adding to the peculiarity of the issue.
My investigation till now
Ruled out any chef aspects from the problem . Was able to confirm that the scripts are doing what they are suppose to do - delete old war DIR -> unzip new war DIR in place(we use exploded war's) there by causing un-deploy of old and deployment of new.
Next point of investigation was to see if the tomcat is deploying the new web app even before its completely unzipped or extracted - this was not the case as confirmed by time lines on the logs.
We do not have jar's getting locked - so ruled out any issues caused by such scenarios.
All of the symptoms I see now points towards tomcats auto deployment policies - but was not able to see anything here which would cause such kind of inconsistency - Have gone through tomcat bug list sniffing for any compatibility issues but was not able to find any.
Am putting it out there to see if any one else is facing similar issues - any thoughts are welcome. Let me know if you need any more information

Jboss taking long time to start

I am using jboss-4.0.5.GA for project deployment, but it is hanging at startup by displaying message
Trying to install an already registered mbean: jboss.management.local
it is showing this for 6 minutes and it takes total 7-8 minutes to start.
If I start server without deploying application, then also it's taking 7 to 8 min.
You seem to have corrupted the JBoss installation, highly reccomended to use a fresh installation and deploy your application rather than debug this.
I use Jboss 4.2.2 which is taken from a zipped folder. Today I have renamed the existing setup and tried unzipping again and use a fresh copy. This didn't work out as expected and server is in starting mode for several minutes and thrown error in the end. So removed this fresh setup and used the old one and it worked like a gem, though not sure where is the problem here.

Unable to reconnect to Derby from Tomcat server started via Eclipse

I'm running on Win 7 using Eclipse 4.2 starting a web app on a Tomcat 7 server and using Derby database. I have tried many approaches but run consistently into a common problem:
Everything works just fine the first time I start up and run.
When I redeploy my application after a change, all database connections hang (any kind of restart).
If I stop Eclipse and restart Eclipse, that clears up the problem and the next run works fine again.
Having done some investigation, it appears that the problem is that the Derby port (1527) is not released from one execution of the server to the next. That seems very strange to me since Derby is started by the Tomcat instance which is a separate javaw process.
I've tried:
Configuring the Derby connection as a Tomcat resource
Establishing the connection within my code (rather than via Tomcat resource)
Both the embedded and the network driver
Starting / stopping the network driver from a servlet on startup and shutdown of the Tomcat server
Shutting down the embedded driver via servlet on shutdown of Tomcat
Again, every approach works fine to connect the first time.
One other symptom that doesn't appear to be related (except for as a possible indicator of whether or not shutdown completes correctly) is that the db.lck file for my database never gets deleted. However, whether or not it exists has no bearing on whether or not I can reconnect (only stopping/starting eclipse has an impact).
Any insight would be appreciated.
Thanks!
After some further investigation I'm going to call this a duplicate of: Cannot create JDBC driver of class ' ' for connect URL 'null' : I do not understand this exception. It's not quite the same thing, but that solution (creating META-INF/context.xml) allows it to proceed to failing calls rather than hangs, which is a significant improvement and suggests it's largely related.
I did finally figure this out. It turns out I had the derby jars in the Tomcat lib folder (for Tomcat) and in the deployment assembly for my application in Eclipse (rather than just in the build path). So Tomcat was using the built-in libs, while my app was using the embedded libs, and this resulted in conflicts. Leaving the libs as part of Tomcat and removing them from my war file solved the problem completely.

Tomcat in Eclipse remains starting/synchronized but is actually running

I'm having the following problem with Eclipse 3.7 and Tomcat 7.0.8: I've added my Tomcat with a deployment descriptor in my Eclipse. I've enabled "Use Tomcat installation" in the server settings and tried to start it. The Console in Eclipse says "Server started up in 70s", I can access my application, but the servers state remains "Starting/Synchronized". As a result sooner or later the configured timeout is triggered and I'm getting an error.
Why is Eclipse not recognizing that the server was started successfully?
I've also tried to reinstall Eclipse and Tomcat - no positive changes.
Also adding a clean, fresh downloaded Tomcat results in the same "error".
Any suggestions?
Richard
Try changing the HTTP port from the server configuration screen. For example if you previously had 8080, try changing it to 8090. This should automatically update the new port number to server.xml.
I started running into the same problem after I had been modifying the server port directly in server.xml. Changing the ports back to what they had been did not seem to solve the problem. It looked like the server pluging and actual configuration got somehow out of sync.

Netbeans not keeping added server after restart

When I add a new server (glassfish) or another, it works just fine. I can startup the server and deploy apps on it.
But, every time I restart netbeans the added servers are not there. It means I must add servers every time I open netbeans.
I'm using netbeans7.
Thanks.
Well, it is not happening any more on netbeans 7.2. If it was a bug, it has been fixed.