cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

PDFExport not working on Red Hat Linux

Level 1

PDFExport not working on Red Hat Linux

I have installed the PDFExport extension on Thingworx 7.2.4 on my local machine (Windows 10, Tomcat 8), then it works perfectly.

But when I installed on the our production server (Thingworx 7.2.4, Red Hat Linux, Tomcat 8), then createPDF service of the extension remain busy and never ends up ... there is no entry in Application log...

I've created openings inward to the server on ports 10000-10007, but no effects.


I've created my own extension to generate simple pdf, that extension works and generates pdf file and saves the file into a FileRepository. So there is no issue of creating files on the server.


Could you help me to use the PDFExport extension on our production server?



33 REPLIES 33

Re: PDFExport not working on Red Hat Linux

Do you see any errors in the Application logs when you try to export in your production server?

Re: PDFExport not working on Red Hat Linux

Hi Mahboob,

I am the creator of the PDF Extension, and I was just made aware of your issue.

Could you help me by telling me if in your extension you used the getRootPath() method of the FileRepository in order to construct the path for the saved the generated PDF there?

Main thing would be, as Tori asked, to understand if there are any errors in the Application Log - also you might want to check the Tomcat logs as well.

Waiting for your answer on this.

Thanks

Vladi

Re: PDFExport not working on Red Hat Linux

Hi Vladimir,

Thank you for your attention. We are using RHEL on our production server, Tomcat 8 and OpenJdk 8.

I don't find any error line in Application log, because the service CreatePDF never completes (remains in executions).

But I found some lines in Tomcat log, see below. It may indicate the problem..??  BTW, when I installed the PDFExtension in Thingworx on Windows 10. Then createPDF works and it can access to the same Mashup of production server.

-------------------------------------------------------------------- Log lines of Tomcat on our production server -----------------------------------

RHINO USAGE WARNING: Missed Context.javaToJS() conversion:

Rhino runtime detected object {mgL=com.thingworx.types.primitives.IntegerPrimitive@3c316fad, TF_Water_PH=com.thingworx.types.primitives.NumberPrimitive@4ee34917, TF_Water_COND=com.thingworx.types.primitives.NumberPrimitive@7c384

ea7, TF_Water_WT=com.thingworx.types.primitives.NumberPrimitive@66dfd097, fetchTimestamp=com.thingworx.types.primitives.DatetimePrimitive@51a497e6, TF_Water_DO=com.thingworx.types.primitives.NumberPrimitive@5dbc734, TF_Water_ORP

=com.thingworx.types.primitives.NumberPrimitive@3b28ec5e} of class com.thingworx.types.collections.ValueCollection where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.java

ToJS() call.

[Port 10002] Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/webkit/network/CookieManager

[Port 10002]    at com.machinepublishers.jbrowserdriver.JBrowserDriverServer.main(JBrowserDriverServer.java:70)

[Port 10002] Caused by: java.lang.ClassNotFoundException: com.sun.webkit.network.CookieManager

[Port 10002]    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

[Port 10002]    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

[Port 10002]    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

[Port 10002]    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

[Port 10002]    ... 1 more

RHINO USAGE WARNING: Missed Context.javaToJS() conversion:

Rhino runtime detected object {Precipitation=com.thingworx.types.primitives.NumberPrimitive@106da9f3, mgL=com.thingworx.types.primitives.IntegerPrimitive@6e2289f7, TF_Water_PH=com.thingworx.types.primitives.NumberPrimitive@68404

55c, Weather_Temperature=com.thingworx.types.primitives.NumberPrimitive@23cec989, Symbol=Sun, SymbolNumber=com.thingworx.types.primitives.NumberPrimitive@6bc455e4, TF_Water_WT=com.thingworx.types.primitives.NumberPrimitive@62ccd

0b9, fetchTimestamp=com.thingworx.types.primitives.DatetimePrimitive@15953b02, TF_Water_DO=com.thingworx.types.primitives.NumberPrimitive@6f026576, TF_Water_ORP=com.thingworx.types.primitives.NumberPrimitive@582b76f} of class co

m.thingworx.types.collections.ValueCollection where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.

[Port 10003] Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/webkit/network/CookieManager

[Port 10003]    at com.machinepublishers.jbrowserdriver.JBrowserDriverServer.main(JBrowserDriverServer.java:70)

[Port 10003] Caused by: java.lang.ClassNotFoundException: com.sun.webkit.network.CookieManager

[Port 10003]    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

[Port 10003]    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

[Port 10003]    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

[Port 10003]    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

[Port 10003]    ... 1 more

RHINO USAGE WARNING: Missed Context.javaToJS() conversion:

Rhino runtime detected object {Precipitation=com.thingworx.types.primitives.NumberPrimitive@2cddc2c4, mgL=com.thingworx.types.primitives.IntegerPrimitive@54f42dfd, TF_Water_PH=com.thingworx.types.primitives.NumberPrimitive@57b52271, Weather_Temperature=com.thingworx.types.primitives.NumberPrimitive@45784ab7, Symbol=Sun, SymbolNumber=com.thingworx.types.primitives.NumberPrimitive@7d3e55ee, TF_Water_WT=com.thingworx.types.primitives.NumberPrimitive@5ecae326, fetchTimestamp=com.thingworx.types.primitives.DatetimePrimitive@6233fc6c, TF_Water_DO=com.thingworx.types.primitives.NumberPrimitive@17ddae12, TF_Water_ORP=com.thingworx.types.primitives.NumberPrimitive@6905a032} of class com.thingworx.types.collections.ValueCollection where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.

[Port 10004] Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/webkit/network/CookieManager

[Port 10004]    at com.machinepublishers.jbrowserdriver.JBrowserDriverServer.main(JBrowserDriverServer.java:70)

[Port 10004] Caused by: java.lang.ClassNotFoundException: com.sun.webkit.network.CookieManager

[Port 10004]    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

[Port 10004]    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

[Port 10004]    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

[Port 10004]    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

[Port 10004]    ... 1 more

Re: PDFExport not working on Red Hat Linux

Hi Mahboob,

Can you see if you have you're using the openJDK - which is not compatible with ThingWorx - it's in the documentation. You should use the Oracle JVM

BR,

Vladimir

Re: PDFExport not working on Red Hat Linux

I have installed Oracle JDK 8 and set configuration in the server to use Oracle JDK and JRE_HOME in Tomcat. But there is no affect and same exception:

[Port 10000] Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/webkit/network/CookieManager

[Port 10000]    at com.machinepublishers.jbrowserdriver.JBrowserDriverServer.main(JBrowserDriverServer.java:70)

[Port 10000] Caused by: java.lang.ClassNotFoundException: com.sun.webkit.network.CookieManager

[Port 10000]    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

[Port 10000]    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

[Port 10000]    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

[Port 10000]    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

[Port 10000]    ... 1 more

Highlighted

Re: PDFExport not working on Red Hat Linux

We get a NoClassDefFound error when code is compiled with an incompatible version of the class found at runtime. The specific instance I recall is with the apache axis library. There were actually 2 versions on my runtime classpath and it was picking up the out of date and incompatible version and not the correct one, causing a NoClassDefFound error.

There could be numerous other reasons , however from the explanation of the issue , it seems to be most appropriate.

Re: PDFExport not working on Red Hat Linux

I have updated Oracle JDK and it has ext/jfxrt.jar. Now I get the following error:

Unable to Invoke Service CreatePDF on PDFExport : Not on FX application thread; currentThread = RMI TCP Connection(2)-10.39.21.4

Even I have created log4j.properties file in lib directory, but I see the following lines in catalina.out file

------------- In catalina.out ------------------

[Port 10000] log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies).

[Port 10000] log4j:WARN Please initialize the log4j system properly.

[Port 10000] log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Re: PDFExport not working on Red Hat Linux

Hey guys,

Happy New Year!

I have seen that the Extension throws this error on the latest Java Runtime - it used to work in the past.

When there's any issue with a ThingWorx Labs extension, we can give the source code the extension so that whoever wants can debug/modify it.

That's was the original intention of the extensions, and while we mention the "no support" in the Author page for the extension, it doesn't clearly states we can deliver the source code.

Would this be ok for you?

Best regards,

Vladimir

Re: PDFExport not working on Red Hat Linux

Hello, I'm trying the new version of PDFExport (March 2017) and I have the same error. Could you get it to work ?