![]() |
![]() |
![]() |
![]() |
This topic describes how to set up and use a JBoss 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 JBoss documentation.
If you are using JBoss 3.2.3, we recommend that you upgrade to a newer version. The Workshop Studio products do not support versions of JBoss prior to 3.2.8. For JBoss 3.2.3, consult the Installation Instructions for a possible workaround.
To define a server:
Choose the server by expanding JBoss 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:
From Server Overview you can view and set deployment and runtime properties.
Note the Run module directly from the workspace option. This is a WTP feature that allows you to run your application in "exploded" mode where the application runs directly from your workspace. If you wish your application compiled into a WAR file and deployed, you must uncheck this option.
Click here for information on manual deployment.
Running and debugging applications is the same for all servers.
Workshop Studio supports hot deployment of JSPs and other artifacts like Struts actions.
If you update a JSP, changes are automatically published to the server and you can simply click the Refresh button to see them running live on the server. Other changes are automatically deployed and the application is restarted as necessary.
For JBoss servers, Workshop Studio integrates Workshop DevLoader (similar to Sysdeo DevLoader for Tomcat) which allows web project to use libraries/classes either from dependent projects or from external location (i.e. outside of project's WEB-INF/classes or WEB-INF/lib folder). Workshop detects the external references and resolves them by doing the following:
In addition the user must manually enable the UseJBossWebLoader flag in the jboss- \server\default\deploy\jbossweb-tomcatxx.sar\META-INF\jboss-service.xml file ( <attribute name="UseJBossWebLoader">true</attribute> ) and restart the server.
Note that Workshop DevLoader works only in exploded mode (the Run modules directly from the workspace option on the Server Overview).
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.
You will see this screen that allows you to specify a custom configuration XML file.
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 and then define the remote server's address.
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.
Workshop uses standard JPDA and self-generated line maps. The JSR-45 debug information has to be disabled by placing the following servlet in the application web.xml file:
<servlet> <servlet-name>nitrox-debugger-jboss4</servlet-name> <description>Added to compile JSPs without JSR-045 debug info</description> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> <init-param> <param-name>suppressSmap</param-name> <param-value>true</param-value> </init-param> <load-on-startup>3</load-on-startup></servlet> <servlet-mapping> <servlet-name>nitrox-debugger-jboss4</servlet-name> <url-pattern>*.jsp</url-pattern></servlet-mapping>
Workshop uses standard JPDA and self-generated line maps. The JSR-45 debug information has to be disabled by placing the following servlet in the application web.xml file.
<servlet> <servlet-name>nitrox-debugger-jboss32</servlet-name> <description>Added to compile JSPs without JSR-045 debug info</description> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> <init-param> <param-name>suppressSmap</param-name> <param-value>true</param-value> </init-param> <load-on-startup>3</load-on-startup></servlet> <servlet-mapping> <servlet-name>nitrox-debugger-jboss32</servlet-name> <url-pattern>*.jsp</url-pattern></servlet-mapping>
Open run.bat in the <JBoss Install Directory>\bin folder and define the following environment variable at the start of the BAT file:
set JAVA_OPTS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n
Start JBoss using run.bat. The JBoss Server console should display 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 JBoss 4.0.x and 3.2.x
$JBOSS_ROOT\server\default\work\jboss.web\localhost\[CONTEXT_ROOT]
e.g.:
C:\jboss-4.0.3SP1\server\default\work\jboss.web\localhost\_
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.
![]() ![]() |