ILOG JRules User Guide > Running and Debugging > Getting Started > Tutorial: Debugging a Remote Rule Execution Server Application > Task 3: Preparing for a Remote Debug Session in Rule Studio

In this task you will enable debugging on the ruleset and the application server, and embed and deploy the loan validation application with an SSP client.

Step 1: Enabling Debugging on the Ruleset

You enable debugging on the loanvalidationrules ruleset through the Rule Execution Server Console.

To enable debugging:

  1. Start the Rule Execution Server Console.
  2. On Windows, click Start > All Programs > ILOG > ILOG JRules version > Web Interfaces > Desktop Rule Execution Server.
  3. If you are using a different application server to the JBoss server provided with JRules, use one of the following URLs:
  4. - Oracle managed: http://localhost:7777/bres
    - Oracle standalone: http://localhost:8888/bres
    - Sun AS 82: http://localhost:8080/bres
    - WebSphere: http://localhost:9080/bres
    - WebLogic: http://localhost:7001/bres
    - Other: http://<ServerName>:<PortName>/bres
  5. Enter the following login information:
  6. Username: bres
    Password: bres
    This the default login for the JBoss server provided with JRules.
  7. Click Sign In.
  8. Click the Explorer tab.
  9. The RuleApps View is displayed.
    images/ruleappsview.png
  10. Click the loanvalidation RuleApp in the RuleApps table.
  11. The loanvalidation RuleApp View is displayed.
  12. Click loanvalidationrules in the ruleset table.
  13. The Ruleset View is displayed.
  14. On the menu bar, click Edit.
  15. The ruleset summary box becomes editable:
    images/loanvaliddebug.png
  16. Select the Debug check box.
  17. On the menu bar, click Save.
  18. The Ruleset View shows that debug mode is now enabled for the ruleset:
    images/loanvaliddebugmode.png

Step 2: Deploying the Loan Validation Application with a SSP Client

To debug a ruleset more easily than using an application that comprises multiple pages, the Rule Execution Server Console enables you to execute a ruleset using an SSP client.

In order to accomplish this execution, the SSP client must be embedded inside the loan validation application. Under the task3/<applicationserver> directories, the loan validation EAR contains the SSP client.

The loan validation EAR file can be deployed to an application server in many different ways. We suggest that you to refer to the application server documentation for a clear understanding of the different options

To deploy the EAR if you use JBoss installed with JRules:

  1. In a command prompt type:
cd <InstallDir>/executionserver/tutorials/resdebugging/task3/jboss40
  1. Then type: ant deploy

You can also deploy the EAR on a version of JBoss not supplied with JRules.

To deploy the EAR on a version of JBoss not supplied with JRules:

  1. Copy the loan-validation-JBOSS40.ear file provided in the task3/jboss40 directory.
  2. Paste the file into: <JBOSS_HOME>/server/default/deploy.
  3. Note
    You can reconstruct the EAR file by running the build.xml script in the application server directories under task2.

    For example, to compile and deploy the EAR on JBoss type the following in a command prompt:

    1. cd <InstallDir>/executionserver/tutorials/resdebugging/task3/jboss40
    2. ant jboss40.ear deploy

You can also deploy the EAR file on Sun AS 82, WebLogic, WebSphere or Oracle 10g. The procedure is the same in each case.

To deploy the EAR file on Sun AS 82, WebLogic, WebSphere or Oracle 10g:

  1. Login to the application server administration console.
  2. Select deploy a new application and choose the loan validation EAR file specific to the application server in:
  3. <InstallDir>/executionserver/tutorials/resdebugging/task3.

Step 3: Enabling Debugging in the Application Server

How you enable debugging in the application server depends on the application server you are using.

To enable debugging if JBoss was installed with JRules:

  1. Stop the JBoss server:
  2. On Windows, click Start > All Programs > ILOG > ILOG JRules version > Web Interfaces > Stop JBoss server.
    On UNIX, use the stopserver executable in the <InstallDir>/shared/bin directory.
    Wait for the JBoss Server to stop.
  3. Start the Samples Console.
  4. On Windows, click Start > All Programs > ILOG > ILOG JRules version > Samples Console.
    On UNIX, use the samples executable in the <InstallDir>/shared/bin directory.
  5. In the Samples Console, click the Server Trace tab, and wait for the server to be started.
  6. Click Stop Server.
  7. Wait for the server to stop.
  8. Click Start Server (Debug).
  9. The following message should appear:
    Waiting debugger connection ....

If you are using a JBoss server not installed with JRules, you set the environment variable.

To enable debugging if JBoss was not installed with JRules:

  1. Go to the JBOSS_HOME/bin directory and set the environment variable JAVA_OPTS as follows:
  2. set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=7777,server=y,suspend=y
  3. Run the JBoss start up script run.[bat|sh].

You can also deploy the EAR on application servers other than JBoss.

You enable debugging on a Sun AS 82 server using the Admin Console.

To enable debugging on Sun AS 82:

  1. Log on to the Admin Console.
  2. In the left pane, click Application Server.
  3. In the right pane, select JVM Setting.
  4. Select the Debug option and click Save.
  5. Restart your server. Note that this service uses the port 9009 for debugging.

You enable debugging on an Oracle10g server by setting the environment variable.

To enable debugging on Oracle10g:

  1. Stop the server.
  2. Set the environment variable OC4J_JVM_ARGS as follows:
  3. set OC4J_JVM_ARGS="-Xdebug -Xrunjdwp:transport=dt_socket,address=7777,server=y,suspend=y"
  4. Start the server.
  5. ORACLE_HOME/bin/oc4j -start

You enable debugging on a WebLogic 9.2 or 10 server by adding a debug variable to the startWeblogic.[cmd|sh] script.

To enable debugging on WebLogic 9.2 and 10:

  1. Stop the server:
  2. stopweblogic.[cmd|sh]
  3. Add the variable DEBUG_OPTS to the startWeblogic.[cmd|sh] script as follows:
  4. set DEBUG_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=7777,server=y,suspend=y -Dilog.rules.engine.sequential.debug=true
  5. Insert the new variable to the WebLogic start up command, after %JAVA_HOME%/bin/java and preferably before the other options.
  6. Your start up script should look like:
    set DEBUG_OPTS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=7777 -Dilog.rules.engine.sequential.debug=true
    "%JAVA_HOME%\bin\java" %DEBUG_OPTS% %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS%-Dweblogic.Name=%SERVER_NAME% -Dweblogic.management.username=%WLS_USER% -Dweblogic.management.password=%WLS_PW% -Dweblogic.management.server=%ADMIN_URL% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy="%WL_HOME%\server\lib\weblogic.policy" weblogic.Server

You enable debugging on a WebSphere 6.1 server using the administration console.

To enable debugging on WebSphere 6.1:

  1. Open the administration console of the remote WebSphere server in a browser.
  2. Expand the Servers node and click Application Servers. Click the appropriate server name to open the application server properties screen.
  3. Click Debugging Service.
  4. Select the Startup check box. Note that, by default, the service uses port 7777 to receive a connection from the debugger client. You can change it if you want.
  5. Click Apply and save the configuration.
  6. Stop the application server if it is running.
  7. Start the server. This time the server will start in debug mode and will take a little longer to start.

images/arrow_next.gif Next: Task 4: Debugging a Remote Ruleset in Rule Studio