Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug remote Glassfish web app from Eclipse?

The web app I'm trying to debug only exhibits a bug on a particular Glassfish server, so I want to debug the web app remotely. But the web app was developed in Eclipse for Java SE and I can't see how to do that.

I have:

  1. Installed Eclipse 3.7 for Java EE
  2. Installed the Glassfish adapter
  3. Configured the server for secure login and JPDA debugging
  4. Added the server as a server in Eclipse

However, I do not see "Run on server" or "Debug on server" in the Run menu of Eclipse. If do Debug as, I can create a new Glassfish configuration but I can't select a server, so I can't configure the configuration.

like image 650
Robin Green Avatar asked Dec 22 '11 10:12

Robin Green


1 Answers

For Glassfish 3:

First enable debugging in the Glassfish administration console (Application Server -> JVM Settings -> General -> Debug Options) which require restarting the domain. Make a note of the port number.

Then you can attach to the Glassfish debug port like any other debug session, with a "Remote Java Application" in the debug configurations.

like image 133
Thorbjørn Ravn Andersen Avatar answered Nov 08 '22 07:11

Thorbjørn Ravn Andersen