Friday, January 31, 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

Monday, January 20, 2014

NextReports Designer: Validate sql in version 7.0

NextReports Designer has a feature (action) which allows to validate queries, reports and charts regarding their query. Till 7.0 version, this validation only showed if something was wrong through a simple message and a warning icon inside browser tree.

From version 7.0, validation process will show as result what is wrong with the query (sql error message). If more queries are invalid, a list with all the errors is shown.


Validation process also takes care about parameters queries and sub-reports queries. This process does not show all errors from a single report (if there are more sql queries to test), but only the first.

This validation process becomes very useful if you have many reports / charts created on some database tables /columns and some table name or column name was changed. By using the replace button, you can automatically do a case sensitive or a case insensitive replace from designer.