### Deploying to jboss-as-7.1.1.Final or JBoss EAP 6.4

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, that is, `C:\JReport\Server` instead of `/opt/JReport/Server`.

The following takes jboss-as-7.1.1.Final as an example.

It is assumed that:

- jboss-as-7.1.1.Final is installed in the `/opt/jboss-as-7.1.1.Final` directory.
- The JReport 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 Server.

To deploy JReport Server to jboss-as-7.1.1.Final:

1. Ensure that JBoss is shut down by running the script `/opt/jboss-as-7.1.1.Final/bin/shutdown.sh -S`.
2. To resolve the issue that JBoss AS 7/EAP 6 cannot locate jrenv.jar, when building a WAR/EAR to deploy to JBoss AS 7/EAP 6, add -Djbossas7=true in makewar.bat/sh.
3. After jreport.war is generated, you need to create a file named jboss-deployment-structure.xml in the jreport.war/META-INF directory. The file should contain the following contents: `

   <?xml version="1.0" encoding="UTF-8"?>

   `

   > `<jboss-deployment-structure>`

   > > `<deployment>`

   > > `<exclusions>`

   > > `<module name="org.apache.log4j" />`

   > > `</exclusions>`

   > > `<dependencies>`

   > > `<system>`

   > > `<paths>`

   > > `<path name="com/sun/org/apache/xml/internal/security/utils"/>`

   > > `</paths>`

   > > `</system>`

   > > `</dependencies>`

   > > `</deployment>`

   > `</jboss-deployment-structure>`

4. Deploying jreport.war to JBoss AS 7 costs some time. When there is a setting deployment-timeout="60" in `<JBoss_home>/standalone/configuration/standalone.xml`, change the value to 180 (seconds) or a bigger number.
5. Start JBoss by running the standalone.sh script.
6. Access JReport Server using the following URLs:

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

7. If formulas cannot be compiled when running sample reports, you need to use JReport Designer to compile formulas and then publish the reports to the integrated JReport Server once again.

#### Troubleshooting

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

1. Modify the file run.sh in `/opt/jboss-as-7.1.1.Final/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 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-as-7.1.1.Final/server/default/log/server.log.`