Generate pdf document on server

0
I am using Generate Document to create and download a pdf document via a Document Template. This is working fine locally, but when I deploy it to the server, I get the error below. I'm logged in with a user with the same role in both places. Anyone have any idea what might be causing this? 2015-11-23 20:13:10.267 CRITICAL - ActorSystem: Uncaught fatal error from thread [MxRuntimeSystem-akka.actor.action-dispatcher-16] shutting down ActorSystem [MxRuntimeSystem] 2015-11-23 20:13:10.267 CRITICAL - ActorSystem: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279) at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501) at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at org.apache.xerces.jaxp.DocumentBuilderImpl.newDocument(Unknown Source) at com.mendix.documentexporter.documents.FOBasedDocument.<init>(FOBasedDocument.java:51) at com.mendix.documentexporter.documents.PDFDocument.<init>(PDFDocument.java:44) at com.mendix.documentexporter.DocumentGenerator.exportToInputStream(DocumentGenerator.java:99) at com.mendix.documentexporter.DocumentGenerator.exportToIMendixObject(DocumentGenerator.java:79) at com.mendix.documentexporter.actions.microflow.DocumentExportAction.execute(DocumentExportAction.scala:74) at com.mendix.documentexporter.actions.microflow.DocumentExportAction.execute(DocumentExportAction.scala:17) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:49) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:196) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:151) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:53) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:291) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:276) at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:204) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:37) at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:199) at com.mendix.core.component.InternalCore.execute(InternalCore.java:264) at com.mendix.webui.actions.client.ExecuteAction.execute(ExecuteAction.java:135) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply$mcV$sp(ClientRequestHandler.scala:299) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:292) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:292) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2$$anon$1.execute(ActionDispatching.scala:151) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:37)
asked
6 answers
1

I think it's a problem with your xml-apis.jar file in the userlib folder.

If you look at This troubleshooting page you might want to replace the xml-apis.jar file.

More information: Stackoverflow regarding NoClassDefFound ElementTraversal

answered
1

This might not be the sollution, but we had a similar case in our office. In our application we had some pages in our app that would show the NoClassDefFoundError on the page. The strange part was that we had a couple of machines that just worked, but also a couple of machines that would show the error. After some time we found the problem. The app would run in production on Java 1.8. But when looking at the preferences of the model some people had a 1.8 JDK and some people had still an old 1.7 JDK in the preferences. The 1.8 JDK would work and the ones with the 1.7 would give the NoClassDefFoundError on random pages. So you might check your own preferences on this app and check if you are running the same version in the cloud.

Again it could not be your problem but it might be worth checking out.

Regards,

Ronald

answered
0

Are there any Java JAR files in the userlib of the project that are also in runtime\bundles of your Mendix installation? You may attempt deleting the duplicates. Save them first.

answered
0

2015-12-03 12:29:40.897 CRITICAL - ActorSystem: Uncaught fatal error from thread [MxRuntimeSystem-akka.actor.action-dispatcher-48] shutting down ActorSystem [MxRuntimeSystem] 2015-12-03 12:29:40.897 CRITICAL - ActorSystem: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279) at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501) at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at org.apache.xerces.jaxp.DocumentBuilderImpl.newDocument(Unknown Source) at com.mendix.documentexporter.documents.FOBasedDocument.<init>(FOBasedDocument.java:51) at com.mendix.documentexporter.documents.PDFDocument.<init>(PDFDocument.java:44) at com.mendix.documentexporter.DocumentGenerator.exportToInputStream(DocumentGenerator.java:99) at com.mendix.documentexporter.DocumentGenerator.exportToIMendixObject(DocumentGenerator.java:79) at com.mendix.documentexporter.actions.microflow.DocumentExportAction.execute(DocumentExportAction.scala:74) at com.mendix.documentexporter.actions.microflow.DocumentExportAction.execute(DocumentExportAction.scala:17) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.java:49) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.java:196) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.java:151) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:53) at com.mendix.core.actionmanagement.CoreAction.doCall(CoreAction.java:291) at com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:276) at com.mendix.core.actionmanagement.ActionManager$1.execute(ActionManager.java:204) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:37) at com.mendix.core.actionmanagement.ActionManager.executeSync(ActionManager.java:199) at com.mendix.core.component.InternalCore.execute(InternalCore.java:264) at com.mendix.webui.actions.client.ExecuteAction.execute(ExecuteAction.java:135) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply$mcV$sp(ClientRequestHandler.scala:299) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:292) at com.mendix.webui.requesthandling.ClientRequestHandler$$anonfun$handleRequest$1.apply(ClientRequestHandler.scala:292) at com.mendix.core.session.Worker$$anonfun$receive$3$$anonfun$2$$anon$1.execute(ActionDispatching.scala:151) at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:37)

answered
0

Did anyone find a solution to this issue?

answered
0

Hi,

To all those who stumble upon this issue, here is the solution.

Just update your m2ee tools on the server. That is it. It will start working. We upgraded from 0.5.2 to 0.5.11 and now we are able to generate PDF's.

We raised a ticket with Mendix Support Portal and after their R&D they provided this solution.

Regards, Sharad R K

answered