« CVS, JUnit and Ant with JDeveloper 10.1.3 Demo | Main | Howto: Deploy ADF application on Tomcat 5.5 using JNDI »

Setting up Remote Debugging with JDeveloper 10.1.3 EA1 and OC4J 10.1.3 DP4

One of the things I often see requests for in the JDeveloper forum is setting up remote debugging for web applications.
Setting it up for Servlets is quite easy - you just mark your project run/debug configuration to do remote debug and set the attach to JPDA in the remote-debug specific runtime configuration node.
Then you start your OC4J with the debug parameters - something like this:

C:dp4j2eehome>c:jdk5binjava -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 -jar oc4j.jar

Now set a break-point in your servlet and run a remote debug - once you invoke the servlet from a browser it should reach the breakpoint.

For JSPs there is one more step that is needed. (In the JDev 10.1.3 EA1 the online help is a little out-dated and details some extra steps that are not needed)

You need to edit the global-web-application.xml file in the OC4J config directory and have at-least the following parameters set for the JSP part:

<init-param> <param-name>debug</param-name>
<param-value>true</param-value> </init-param>
<init-param> <param-name>developer_mode</param-name>
<param-value>true</param-value> </init-param>
<init-param> <param-name>encode_to_java</param-name>
<param-value>true</param-value> </init-param>
<init-param> <param-name>reduce_tag_code</param-name>
<param-value>false</param-value> </init-param>
<init-param> <param-name>extra_imports</param-name>
<param-value></param-value> </init-param>
<init-param> <param-name>main_mode</param-name>
<param-value>recompile</param-value> </init-param>
<init-param> <param-name>debug_mode</param-name>
<param-value>true</param-value> </init-param>

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)