Tuesday, January 12, 2010

Netbeans and Tomcat: Shared Memory Realm problems when Tomcat is started in Debug Mode

Tomcat and Netbeans don't play nice. Everything starts out well, but the situation goes downhill every time the application is deployed, usually necessitating killing of Tomcat's JVM after a few deploys.

Finally I ran into a show stopper. It always goes away, yet I don't know what action causes it to go away, and then it comes back again later. The exact error was:

ERROR: transport error 202: failed to accept shared memory connection: stream closed

It only happens when Tomcat is started via Netbeans in debug mode. Sometimes there would be no error but no breakpoints were ever triggered.

How to fix it? Don't use a shared memory realm for debugging. The Netbeans and Tomcat JVM need some way to communicate during debugging and Netbeans provides two methods.

Go to services. Expand Servers and right click on Tomcat. Choose properties and select the startup tab. Change the radio button from Shared Memory Name to Socket Port. Kill Tomcat and start it in debug mode. Voila.

3 comments:

Anonymous said...

Thanks for the tip!

Miguel Perez said...

I looked every where to fix the debug out of memory problem in netbeans/tomcat. Thank you so much, I absolutely appreciate your article. It worked perfectly.

Anonymous said...

Thank you, 7 years later!!

Labels

Blog Archive

Contributors