4
* Copyright � 2007 Sun Microsystems, Inc. All rights reserved.
5
* Use is subject to license terms.
8
<title>Debugging an EJB Module</title>
9
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
10
<link rel="stylesheet" href="nbdocs://org.netbeans.modules.usersguide/org/netbeans/modules/usersguide/ide.css" type="text/css">
13
<h2>Debugging an EJB Module</h2>
14
<p><small><a href="#seealso">See Also</a></small></p>
15
<p>There are two ways to debug an EJB module:</p>
17
<li>As a stand-alone EJB module</li>
18
<li>As part of an enterprise application</li>
20
<p><b>To debug a stand-alone EJB module:</b></p>
22
<li>In the Projects window, right-click the EJB module project and choose Debug. </li>
24
<p>When you debug a stand-alone EJB module, the IDE does the following:</p>
26
<li>Compiles the EJB module if necessary.</li>
27
<li>Stops the application server and starts it in debug mode.</li>
28
<li>Deploys the EJB module to the application server.</li>
29
<li>Starts a debugging session, attaches the debugger to the server, and opens
30
the debugger windows at the bottom of the IDE screen. Since an EJB module
31
does not have an executable class, there are no local variables or calls on
32
the call stack. To debug the functionality in the EJB module, use an application
33
client or web application to access the EJB module's methods.</li>
35
<p><b>To debug an enterprise application:</b></p>
37
<li>In the Projects window, right-click the enterprise application project and
40
<p>When you debug an enterprise application, the IDE does the following:</p>
42
<li>Compiles the EAR file if necessary.</li>
43
<li>Stops the application server and starts it in debug mode.</li>
44
<li>Deploys the enterprise application to the application server.</li>
45
<li>Starts a debugging session, attaches the debugger to the server, and opens
46
the debugger windows at the bottom of the IDE screen. If the application has
47
a designated web application and URL to run, the IDE opens the URL in the
48
external browser.</li>
52
<li>If your EJB module is part of an enterprise application, you should always
53
debug it by running the debug command on the enterprise application project.
54
Since the IDE does not know which enterprise applications an EJB module project
55
belongs to, running the Debug command on an EJB module project deploys it
56
as a stand-alone module.</li>
57
<li>When debugging an enterprise application, if your application contains any projects
58
not listed in the Packaging page of the enterprise application,
59
you need to explicitly specify these projects if you want the IDE to include
60
them in the classpath when you debug the application.
61
To specify the projects to include, right-click the enterprise application project node
62
in the Projects window and choose Properties.
63
In the Properties dialog box, select the Libraries category
64
and add the projects to the Embedded Classpath Elements list.</li>
65
<li>The debugger windows filter out any information from method calls running
69
<dt><a name="seealso">See Also</a></dt>
70
<dd><a href="../deploy/deploy_ejb.html">Deploying an EJB Module</a></dd>
71
<dd><a href="../deploy/build_ejb.html">Building an EJB Module</a></dd>
72
<dd><a href="../debug/test_ejb.html">Testing an EJB Module</a></dd>
73
<dd><a href="../../enterprise/general/add_modules_to_ent_app.html">Adding a
74
Module to an Enterprise Application</a></dd>
75
<dd><a href="../../server/server_register.html">Registering a Server</a></dd>
78
<hr><small><a href="../../credits.html">Legal Notices</a></small>
79
<table cellpadding="50" border="0">
80
<tr><td> </td></tr>