Glassfish debug with IntelliJ Idea
Last year they did me a very interesting present, Russian Development Pack compound of:
The Idea impressed me, I already have very good references from Roberto, but it's tremendously effective, especially if you already take some years programming in Java, test it one month and you will love it.
I have used Netbeans from its begin, beforre Sun buy it and it was called Forte for Java, the advances have been incredible, especially last years, but sincerely, the don't have the stability of the Idea, the must work as much as the 150€ that it costs (promotion with javahispano on december 2006). Truly, they are 150€, but I believe also that we (people around computers) should be the first ones in recognizing and in appreciating all the effort and quality there is behind this "ridiculous" money.
For me the debugger of the Idea costs the double of this quantity because simply it works, and since it could not perform another form, with Glassfish also work, although in this case, only it does it getting connected in remote. This supposes the snag of the server has to start external form the IDE using its scripts (asadmin tool).
The first step is configure Glassfish so that it starts with debug port enabled,so he have to start Glassfish and from the console administration, we check the option debug in the JVM options
Having done this change, the server asks us to restart so we execute:
asadmin stop-domain domain1
asadmin start-domain domain1
After Glassfish begins we must see in the console following messages
Listening for transport dt_socket at address: 9009
Application server is listening at address 9009 for debugger
to attach using transport dt_socket
From this moment we can get connected remotely with a Debugger JPDA, in our case the Idea. I am not going to enter details of creating a web project in the environment, only i will explain who to execute the project in glassfish. For it, in we add a new server configuration: Glassfish Server --> Remote
The following step is configure Glassfish, for which we must select the directory of installation and add *.jar files that should import classes that we are going to use. We also can give a name to the server and change the config information (Ports and keys of access)
Last step is configure the debug port which the idea will get connected, in our case 9009 (Glassfish default)
With these steps the applications opened in Glassfish could be debugged with all the potency of the Idea debugger











