Debugging an EJB Module
See Also
There are two ways to debug an EJB module:
- As a stand-alone EJB module
- As part of an enterprise application
To debug a stand-alone EJB module:
- In the Projects window, right-click the EJB module project and choose Debug.
When you debug a stand-alone EJB module, the IDE does the following:
- Compiles the EJB module if necessary.
- Stops the application server and starts it in debug mode.
- Deploys the EJB module to the application server.
- Starts a debugging session, attaches the debugger to the server, and opens
the debugger windows at the bottom of the IDE screen. Since an EJB module
does not have an executable class, there are no local variables or calls on
the call stack. To debug the functionality in the EJB module, use an application
client or web application to access the EJB module's methods.
To debug an enterprise application:
- In the Projects window, right-click the enterprise application project and
choose Debug.
When you debug an enterprise application, the IDE does the following:
- Compiles the EAR file if necessary.
- Stops the application server and starts it in debug mode.
- Deploys the enterprise application to the application server.
- Starts a debugging session, attaches the debugger to the server, and opens
the debugger windows at the bottom of the IDE screen. If the application has
a designated web application and URL to run, the IDE opens the URL in the
external browser.
Notes:
- If your EJB module is part of an enterprise application, you should always
debug it by running the debug command on the enterprise application project.
Since the IDE does not know which enterprise applications an EJB module project
belongs to, running the Debug command on an EJB module project deploys it
as a stand-alone module.
- When debugging an enterprise application, if your application contains any projects
not listed in the Packaging page of the enterprise application,
you need to explicitly specify these projects if you want the IDE to include
them in the classpath when you debug the application.
To specify the projects to include, right-click the enterprise application project node
in the Projects window and choose Properties.
In the Properties dialog box, select the Libraries category
and add the projects to the Embedded Classpath Elements list.
- The debugger windows filter out any information from method calls running
on the server.
- See Also
- Deploying an EJB Module
- Building an EJB Module
- Testing an EJB Module
- Adding a
Module to an Enterprise Application
- Registering a Server
Legal Notices