Tuesday, April 24, 2007

Eclipse + Weblogic + Debugging with hot deployment

I had this simple problem...

I have a web application...to be deployed on weblogic...I use Eclipse to work on it...I am in development mode, so I make frequent changes to Java files and JSP's and want to see the effect of changes immediately on browser.

In obscure world of Java...it was not that easy I found...

It has to be an open deployment (where you dont create an archive, but ask the App server to point to your development directory)...


With normal Eclipse debugging using Weblogic instance...it unnecessarily creates an archive...I didnt find an option to use open deployment here.


So one needs to use Remote debugging...It is something with which the server needs to expose its debug data to the IDE on some port (in this case 1044). IDE attaches itself to it.



One needs to make changes to the startup file of the App server to use -Xdebug option to start the JVM in debug mode and expose debug data on some port.


In my case, I created a new CMD file from existing weblogic startup file with following debug options added to JVM startup command.


set DEBUG_OPTS= -Xdebug -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=y

Finally, it did work after some worries and mistakes...
Now I can put a console print in some java class and just refresh my browser to see the output in the console...(of course you need to set 'Build Automatically' in Eclipse)

What a relief... :)

Reference: http://www.jacoozi.com/index.php?option=com_content&task=view&id=119&Itemid=134

No comments: