Executing "js-export" tool is failed on Unified Reporter 8.51

Document ID : KB000092832
Last Modified Date : 24/04/2018
Show Technical Document Details
Issue:
Executing "js-export(.bat for MS Windows or .sh for UNIX/Linux)" tool is failed on Unified Reporter (UR) 8.51 even though "wasp_unified_reports_configurer" is deployed on UR and "js-env(.bat for MS Windows )" is correctly set up.

Here is an example of the error output from "js-export" tool.

>js-export.bat --everything --output-zip c:\jsreports\test.zip
JAVA: Using NIM_JRE_HOME (jre\jre6)
...
Creating ActionModelService object.
Creating action model infrastructure.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actionModelService' defined in file [C:\Program Files\Nimsoft\probes\service\wasp\webapps\jasperserver-pro\import-export\config\applicationContext.xml]:
 Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actionModelService' defined in file [C:\Program Files\Nimsoft\probes\service\wasp\webapps\jasperserver-pro\import-export\config\applicationContext.xml]:
 Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1514)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:638)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:942)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
        at com.jaspersoft.jasperserver.export.BaseExportImportCommand.createSpringContext(BaseExportImportCommand.java:129)
        at com.jaspersoft.jasperserver.export.BaseExportImportCommand.process(BaseExportImportCommand.java:82)
        at com.jaspersoft.jasperserver.export.ExportCommand.main(ExportCommand.java:43)
Caused by: java.lang.ExceptionInInitializerError
        at com.jaspersoft.jasperserver.api.engine.common.service.impl.ActionModel.generateActionModelDocument(ActionModel.java:193)
        at com.jaspersoft.jasperserver.api.engine.common.service.impl.ActionModelServiceImpl.generateActionModelMenus(ActionModelServiceImpl.java:109)
        at com.jaspersoft.jasperserver.api.engine.common.service.impl.ActionModelServiceImpl.afterPropertiesSet(ActionModelServiceImpl.java:77)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1573)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511)
        ... 12 more
Caused by: java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: java.util.ServiceConfigurationError: javax.xml.xpath.XPathFactory: jar:file:/C:/Program%20Files/Nimsoft/probes/service/wasp/webapps/jasperserver-pro/WEB-INF/lib/saxonhe-9.2.1.5.jar!/META-INF/services/javax.xml.xpath.XPathFactory:2: Illegal configuration-file syntax
        at javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:102)
        at com.jaspersoft.jasperserver.core.util.XMLUtil.<clinit>(XMLUtil.java:46)
        ... 17 more
Cause:
The cause is that an library that is included in UR 8.51 cannot correctly work with java_jre 1.80 package that is default of Unified Infrastructure Management (UIM) 8.51. 
Resolution:
The resolution is using JRE 1.72 for executing "js-export" tool, instead of 1.80. Here is the procedure.

1. If java_jre 1.72 package is not deployed on UR, download it from link below, then import it to Archive on Admin Console or Infrastructure Manager and deploy it to UR.
     java_jre 1.72

2. If the java_jre 1.72 package is deployed to UR, then wasp probe on UR will be restarted and value of robot environment variable "NIM_JRE_HOME" that controller probe has will be changed to "jre/jre7". The value can be reverted back to the default value of UIM 8.51, "jre/jre8u102"(Restarting robot is needed.). See the detail below.
     controller AC Configuration > Setup > Environment Variables or controller IM Configuration > Setup > Environment

3. Open "js-env" that is stored on the UR (Default location of the file is "C:\Program Files\Nimsoft\probes\service\wasp\webapps\jasperserver-pro\import-export"), and set the top 2 lines in the file like below.
     set NIM_ROOT=C:\Program Files\Nimsoft (Modify the value if UIM install directory was changed)
     set NIM_JRE_HOME=jre\jre7

4. Execute "js-export" tool. The exporting job will be succeeded.
 
Additional Information:
Related article: Is there a procedure to Save/export the Scheduled Unified Reports (UR) to an External Location?