This topic describes how to set up and use a WebLogic server with the BEA Workshop Studio family of products. The topics discussed here are:
This topic assumes that you already have a server installed locally on your development machine, or on a server available for development. For information on installing, setting up and managing the server, consult the WebLogic Server documentation.
To define a server:
Choose the server by expanding BEA Systems and choosing the appropriate server. Click Next to continue.
Note that you must specify the full JDK (not just the JRE that is the default).
Click Next to continue.
Fill in the appropriate values and click Finish to continue.
Note that the first project is automatically selected in the Select Project to Debug field. You can use the pull-down to specify which project will be debugged.
Only one project at a time can be debugged on the server. The project that is currently allowed to run in debug mode is the project displayed in the Select Project to Debug field. You are not required to run this project in debug mode, but if you wish to debug another project on the server, you must change this setting before debugging the application.
To update the definition for a server:
Running and debugging applications is the same for all servers.
To deploy an application manually requires that you create an alternate configuration. For information on how to create an alternate configuration, consult your server documentation.
To deploy the alternate configuration:
Manual deployment is only allowed when the Run module directly from the workspace option is selected.
For WebLogic 8.1, you will see this screen that allows you to specify a custom configuration XML file OR to use the existing config.xml without updating.
For WebLogic 9, you will see this screen that allows you to use the existing config.xml without updating. For WebLogic 9, you cannot specify the name of a custom configuration file. When you click on Manual deployment with existing configuration, the field specifying the config.xml file name is read-only and the Select button is disabled.
To debug on a remote server (or on a local server which is started and managed OUTSIDE of the IDE), you must configure the server for remote debugging, deploy the application manually and then define the remote server's address.
Configuring the server for remote debugging is a feature of the server. This information is provided for your convenience. For definitive documentation, consult your server documentation.
Workshop uses standard JPDA and self-generated line maps. The JSR-45 debug information has to be disabled. The class debug information has to be enabled by placing the following attributes in the application weblogic.xml file:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd" > <weblogic-web-app> <jsp-descriptor> <jsp-param> <param-name>compileFlags</param-name> <param-value>-g</param-value> </jsp-param> <jsp-param> <param-name>keepgenerated</param-name> <param-value>true</param-value> </jsp-param> </jsp-descriptor> </weblogic-web-app>
Workshop uses standard JPDA and self-generated line maps. The class debug information has to be enabled by placing the following attributes in the application weblogic.xml file:
<?xml version="1.0" encoding="UTF-8"?> <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90";> <jsp-descriptor> <keepgenerated>true</keepgenerated> <working-dir>D:\runtime-workspace-test2\.metadata\.plugins\com.m7.nitrox\struts-example_1_1\WebApp\.m7debugger\weblogic9\struts-example_1_1\work</working-dir> <backward-compatible>true</backward-compatible> <debug>true</debug> </jsp-descriptor> <context-root>/</context-root> </weblogic-web-app>
Add the following line to the script file used to start Weblogic server, e.g. startWeblogic.cmd
set JAVA_OPTIONS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n
The Weblogic Server console should display the message:
Listening for transport dt_socket at address: 8453
Before attempting to debug an application on a remote server, you must:
When remote debugging an application on a physically separate machine, the debugger will hit JSP breakpoints but the IDE will not show the correct source line in JSP, becasue Workshop Studio is trying to locate JSP servlet source for line mapping but the files are not available to the IDE.
To enable source debugging of servlets on a separate server, map the following directory (on the remote server) to a local directory, and use the Source Lookup Path dialog, or the Source tab in the Launch Configuration dialog (the Run > Run command), to add the mapped directory to Source Lookup Path.
For Weblogic 9.x:
The JSP servlet src output folder is specified in \WEB-INF\weblogic.xml in the web application,
this needs to be configured when setting up remote Weblogic server for debugging:
<jsp-descriptor>
<keepgenerated>true</keepgenerated>
<working-dir>C:\temp\jsp-servlet\struts-example_1_1\work</working-dir>
<backward-compatible>true</backward-compatible>
<debug>true</debug>
</jsp-descriptor>
For Weblogic 8.1:
$WLS_DOMAIN\server\.wlnotdelete\extract
e.g.:
C:\bea\user_projects\domains\mydomain\myserver\.wlnotdelete\extract\myserver___wstudio_autoconfig_deployment___struts-example_1_1_dbg
To define a remote server:
Change the Connection Type to Standard (Socket Attach) and specify the Host and Port.
Note that when debugging an application on a remote server, you must not disable the Run module directly from the workspace option when you update server settings.