Friday, 31 January 2014

Deploy NextReports Server on JBoss AS 7.1.1

NextReports Server comes bundled with Jetty server as default. If you want to deploy NextReports Server to other web server you should at first read the special section found inside the manual.

For some servers it is very easy to do:
1. put the war in the deployment folder
2. register reports as web context
3. add reports folder to classpath.

For JBoss there are more things to do:

1. You should create a nextreports-server.war folder and unarchive the war file here (Just putting the war file in deployment it won't work)

2. Create an empty file called nextreports-server.war.dodeploy near nextreports-server.war folder (This is needed to inform JBoss to make the deploy of the exploded folder)

3. Add in web.xml from nextreports-server.war\WEB-INF :
   <context-param>      
        <param-name>resteasy.scan</param-name>
        <param-value>false</param-value>
   </context-param>

   <context-param>
        <param-name>resteasy.scan.resources </param-name>
        <param-value>false </param-value>
   </context-param>

   <context-param>
        <param-name>resteasy.scan.providers </param-name>
        <param-value>false </param-value>
   </context-param>
   These are needed because JBoss uses Resteasy as REST library while Next uses Jersey and these two are in conflict. So we deactivate Resteasy.

4. Current version 6.3 of Next uses an older version of Jersey library (1.7) You should use a newer version (1.18) From version 7.0 of Next the needed version of Jersey will be used by default. So replace the jersey jars from nextreports-server.war\WEB-INF\lib

5. Add following ehcache.xml in nextreports-server.war\WEB-INF\classes
<ehcache>
    <diskStore path="java.io.tmpdir"/>

    <cache name="org.hibernate.cache.UpdateTimestampsCache"
           maxElementsInMemory="50000"
           eternal="true"
           overflowToDisk="true"/>

    <cache name="org.hibernate.cache.StandardQueryCache"
           maxElementsInMemory="50000"
           eternal="false"
           timeToIdleSeconds="120"
           timeToLiveSeconds="120"
           overflowToDisk="true"
           diskPersistent="false"
               diskExpiryThreadIntervalSeconds="120"
           memoryStoreEvictionPolicy="LRU"
            />
    <defaultCache
            maxElementsInMemory="50000"
            eternal="false"
            timeToIdleSeconds="120"
            timeToLiveSeconds="120"
            overflowToDisk="true"
            diskPersistent="false"
            diskExpiryThreadIntervalSeconds="120"
            memoryStoreEvictionPolicy="LRU"
            />
</ehcache>

6. In nextreports-server.war\WEB-INF\classes\nextserver.properties modify  nextserver.home property as you wish.

7. In welcome-content folder from JBoss create reports folder (In this way reports is considered a web context). In server settings put this path to reports.home:  ../welcome-content/reports

1 comment:

  1. We wanted to deploy NextReports server in Ubuntu 14.04 in locally installed tomcat7.

    We have tried our best including the instructions given in the blog....

    The only error message we received is FAIL - Application at context path /nextreports-server.war could not be started

    A clear way to deploy nextreports-server war file are required.

    ( nextreports Version we have tried version 7.3 on Ubuntu 14.04 server edition - 64 bit with 16 GB Ram )

    But surprisingly your installable version works very well.

    ReplyDelete