### Deploying to JBoss 4.0

The example directory paths listed below are based on Solaris or Linux (referred to as UNIX). The instructions are applicable to both UNIX and Windows installations; however, the format of the paths for Windows would use the Windows format, i.e. `C:\JReport\Server` instead of `/opt/JReport/Server`.

It is assumed that:

- JBoss 4.0 is installed in the `/opt/jboss-4.0.1` directory.
- The JReport Enterprise Server WAR file jreport.war is located in the `/opt/JReport/Server/bin/distribute` directory. To create the WAR file refer to the instructions in Building a WAR/EAR file to include a self-contained JReport Enterprise Server.

  Note: If JBoss 4.0.2 or higher version is used, make sure that the file log4j-1.2.8.jar is not included in the JReport Web Application Archive file jreport.war. It is because since JBoss 4.0.2, log4j.jar in JBoss and log4j-1.2.8.jar in JReport Enterprise Server conflict with each other.

To deploy JReport Enterprise Server to JBoss 4.0:

1. Ensure that JBoss is shut down by running the script `/opt/jboss—4.0.1/bin/shutdown.sh -S`.
2. Copy the Web Application Archive jreport.war to `/opt/jboss-4.0.1/server/default/deploy`.
3. Start JBoss by running the run.sh script.
4. Access JReport Enterprise Server using the following URLs:

   `http://localhost:8080/jreport/jrserver
   http://localhost:8080/jreport/admin/index.jsp
   http://localhost:8080/jreport/jinfonet/index.jsp`

Note: When integrating JReport Enterprise Server with Jboss based on Vista, in order to run the RSD format, you need set Java home in the batch file that is used to start Jboss. For example, add the following line in the run.bat file in `C:\jboss-4.0.2\bin`:

`set JAVA_HOME=C:\Program Files\Java\jdk1.6.0`

#### Troubleshooting

If you run into problems when using JReport Enterprise Server in JBoss, send the log files of JReport Enterprise Server to support@jinfonet.com. The following procedure illustrates how to generate the log files:

1. Modify the batch file run.sh in `/opt/jboss-4.0.1/bin`.

   In the file run.sh, add `-Dlogall=true` after the reporthome definition:

       "$JAVA" $JAVA_OPTS \
       -classpath "$JBOSS_CLASSPATH" -Dreporthome=/opt/JReport/Server \
       -Dlogall=true  \
       org.jboss.Main "$@"

2. After editing run.sh, start JBoss using the modified batch file.
3. After reproducing the problem, send support@jinfonet.com the log files in `reporthome/logs`.

   The JBoss log files may also help to identify the problem. The most useful one is `/opt/jboss-4.0.1/server/default/log/server.log.`