File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes Debugging Container code in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Debugging Container code in Eclipse" Watch "Debugging Container code in Eclipse" New topic
Author

Debugging Container code in Eclipse

Gavin Bong
Ranch Hand

Joined: Apr 25, 2003
Posts: 56
Can someone explain what does it take to debug codes that run inside a container of some sort ? By container, I'm talking about components build to the Inversion of Control (IoC) pattern like servlet container, EJB container etc... I basically want to learn how to write a plugin that will allow me to debug EJBs inside Eclipse ? Is this possible ?
Thanks
Gavin
Dan Kehn
Dastardly Dan the Author
Ranch Hand

Joined: Jun 11, 2003
Posts: 120
This is John Kellerman's area of expertise, but I'll go out on a limb and suggest that remote debugging your container from Eclipse would work. That's what WebSphere Application Developer (WSAD) does to debug the WebSphere Application Server (WAS) EJB container. This approach is described in Chapter 4, "Debugging Java" in section "Remote Debugging". Here's the first couple of paragraphs:
The Java Debugger allows you to debug programs remotely, including using hot code replace with JVMs that support it. Remote programs include those running on your local machine outside of Eclipse and programs on another machine, either standalone or in a server environment. In order to display a source and enable you to set breakpoints, the Debugger gets the source for the code being debugged from your workspace.
Debugging a remote program is similar to debugging a local one, except that the remote program must be launched first with certain JVM parameters, and you need to specify a Remote Java Application launch configuration. When you launch your remote program with the parameters specified below, it starts and then suspends waiting for a connection from a debugger. The launch configuration contains information for the JDT Debugger to connect to the JVM running the remote program and initiate a debugging session.

The exercise in Chapter 30, "Debugging Java," covers these steps in detail in Section 3. This is also covered in lesser detail in the Eclipse online documentation under Remote Debugging.
-- Dan


Co-author of <a href="http://www.jdg2e.com" target="_blank" rel="nofollow">The Java Developer's Guide to Eclipse</a>, 2nd Edition<br />(Yahoo group <a href="http://groups.yahoo.com/group/JDG2E/" target="_blank" rel="nofollow">JDG2E</a>)
Gavin Bong
Ranch Hand

Joined: Apr 25, 2003
Posts: 56
What other JVMs support hot code replace ? I know that IBM's JVMs does. Thanks
Sherry Shavor
Author
Greenhorn

Joined: Jul 15, 2003
Posts: 7
Gavin,
Sun JDK1.4 also includes HotSwap, see: JDKSE 1.4.2 release notes
Sherry Shavor


<a href="http://www.awprofessional.com/titles/0321159640" target="_blank" rel="nofollow">http://www.awprofessional.com/titles/0321159640</a>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Debugging Container code in Eclipse
 
Similar Threads
Eclipse + ant question
JUnit EJB problem
jsp/JavaScript - Eclipse Debug perspective ?
How to debug a web service in java?
Debug JSP