• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Debugging Container code in Eclipse

 
Gavin Bong
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gavin Bong
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What other JVMs support hot code replace ? I know that IBM's JVMs does. Thanks
 
Sherry Shavor
Author
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gavin,
Sun JDK1.4 also includes HotSwap, see: JDKSE 1.4.2 release notes
Sherry Shavor
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic