Setup OC4J for remote debugging with Eclipse 

There are 2 notes for this topic, click above title to see all notes.
Joined:
04/09/2007
Posts:
753

May 14, 2008 22:55:22    Last update: May 14, 2008 23:07:49
This procedure works for Oracle application server 10.1.3.1, SOA suite. But should be applicable for standalone OC4J or JDeveloper installations with minor modifications. $ORACLE_HOME is the home directory for Oracle app server. $JDEV_HOME is the home directory for JDeveloper.

1. Change directory to $ORACLE_HOME/j2ee, mkdir lib

2. Copy xmlparserv2.jar from $JDEV_HOME to $ORACLE_HOME/j2ee/lib.

3. Copy ocj.jar and jdev_remote.jar from $JDEV_HOME/jdev/lib to $ORACLE_HOME/j2ee/home/lib.

4. Edit global-web-application.xml under your OC4J instance's config directory. Change the development attribute to true.
<orion-web-app 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-web-10_0.xsd"
  jsp-cache-directory="./persistence"
  servlet-webdir="/servlet"
  development="true"
  jsp-timeout="0"
  jsp-cache-tlds="standard"
  schema-major-version="10"
  schema-minor-version="0"
>


5. Add the following to the servlet section of global-web-application.xml:
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>oracle.jsp.runtimev2.JspServlet</servlet-class>
<init-param>
        <param-name>debug_mode</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>emit_debuginfo</param-name>
        <param-value>true</param-value>
</init-param>
<init-param>
        <param-name>jspjavacompiler</param-name>
        <param-value>oracle.jdevimpl.jsp.JspOjcCompiler</param-value>
</init-param>
</servlet>


6. Edit $ORACLE_HOME/opmn/conf/opmn.xml, add -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 to start-parameters/java-options:
<process-type id="MYOC4J" module-id="OC4J" status="enabled">
<module-data>
<category id="start-parameters">
    <data id="java-options" value="-server -Xmx1280M -Xms1280M -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4000 -Djava.security.policy=$ORACLE_HOME/j2ee/CSC_UI/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false"/>
</category>
<category id="stop-parameters">
    <data id="java-options" value="-Djava.security.policy=$ORACLE_HOME/j2ee/CSC_UI/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false"/>
</category>
</module-data>
<start timeout="600" retry="2"/>
<stop timeout="120"/>
<restart timeout="720" retry="2"/>
<port id="default-web-site" range="8889" protocol="http"/>
<port id="rmi" range="12401-12500"/>
<port id="rmis" range="12701-12800"/>
<port id="jms" range="12601-12700"/>
<process-set id="default_group" numprocs="1"/>
</process-type>


7. In Eclipse, open to port 4000 for remote debugging.
Share |
| Comment  | Tags