This is the most annoying error I got so far with Bonita.
I have Bonita 6.3.4 running on Ubuntu 14.04 32bits with Java “1.6.0_45”
I created a connector to download reports from the jasperserver. Using jasperserver-simple-java-rest-client 1.0.
I have experienced this same error with other connectors.
This is exception is thrown when the connector is executed for the second time:
org.dom4j.DocumentException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.dom4j.DocumentHelper.parseText(DocumentHelper.java:278)
at com.gkudos.jasperserver.client.JasperserverRestClient.parseResource(JasperserverRestClient.java:156)
at com.gkudos.jasperserver.client.JasperserverRestClient.getReportAsFile(JasperserverRestClient.java:115)
at br.edu.uniformg.connector.JasperServerConnector.getReportAsDocument(JasperServerConnector.java:126)
at br.edu.uniformg.connectors.JasperserverConnectorImpl.executeBusinessLogic(JasperserverConnectorImpl.java:66)
at org.bonitasoft.engine.connector.AbstractConnector.execute(AbstractConnector.java:74)
at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:70)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:189)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:171)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Nested exception:
java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97)
at org.dom4j.io.SAXReader.getDocumentFactory(SAXReader.java:645)
at org.dom4j.io.SAXReader.createContentHandler(SAXReader.java:969)
at org.dom4j.io.SAXReader.read(SAXReader.java:449)
at org.dom4j.DocumentHelper.parseText(DocumentHelper.java:278)
at com.gkudos.jasperserver.client.JasperserverRestClient.parseResource(JasperserverRestClient.java:156)
at com.gkudos.jasperserver.client.JasperserverRestClient.getReportAsFile(JasperserverRestClient.java:115)
at br.edu.uniformg.connector.JasperServerConnector.getReportAsDocument(JasperServerConnector.java:126)
at br.edu.uniformg.connectors.JasperserverConnectorImpl.executeBusinessLogic(JasperserverConnectorImpl.java:66)
at org.bonitasoft.engine.connector.AbstractConnector.execute(AbstractConnector.java:74)
at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:70)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:189)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:171)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Reading some related problems I tried to follow instructions to move the libs to the tomcat lib folder to avoid double loading the same class by different class loaders.
Now that I removed and the libs from the connector implementation reference on “dependencies” and put them on tomcat lib folder it throws the same exception on the FIRST time it runs.
I am using jasperserver because I got same errors with normal jasper connectors. I tried to rewrite them but it didn’t work.
Looks like there are more than one class loader loading the same class at different times and then it conflict with them self.
Unhappily with go getting this kind of error will need to quit using Bonita.
I already opened a ticket but no response.
Is this possibly a bug or fail in my code?