jodconverter java.lang.ClassNotFoundException - openoffice.org

I have installed openoffice and jodconverter on ubuntu 12.04 (64) in order to convert .xls into pdf.
I have the same installation on 10.04 (64) working great, however having just built a new machine with freshly installed 12.04, it simply refuses to run.
It is a headless machine and openoffice is called with:
soffice --headless --nologo --nofirststartwizard "--accept=socket,host=127.0.0.1,port=8100;urp"
I have confirmed that it is listening on 8100:
netstat -an | grep 8100
tcp 0 0 127.0.0.1:8100 0.0.0.0:* LISTEN
however runnind jodconverter (to convert pcash.xls to pcash.pdf) always results in this ClassNotFound error:
jodconverter pcash.xls pcash.pdf
Oct 4, 2012 3:07:52 PM com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection connect
INFO: connected
Oct 4, 2012 3:07:52 PM com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection disposing
INFO: disconnected
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/star/task/ErrorCodeIOException
at com.artofsolving.jodconverter.cli.ConvertDocument.main(ConvertDocument.java:129)
Caused by: java.lang.ClassNotFoundException: com.sun.star.task.ErrorCodeIOException
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
I have clicked pretty much every link in google, I have installed open-office with apt-get as well as by downloading the latest and installing from .deb and it makes no difference.
This works flawlessley on 10.04 and yet I have spent the last 6 hours getting nowhere !!

Are you sure you are using openoffice and not libreoffice which is default in ubuntu?
I have experienced some problems with newer versions of LibreOffice.
Also there might be issues with supporting newer versions of OpenOffice since JODConverter is no longer maintained. Try the same OpenOffice version you had with 10.04

Related

localhost connection problem while using StartMeshcat

I am using Ubuntu 22.04 LTS via WSL and working on Python 3.10 on Visual Studio Code using the Remote - WSL extension.
When I import and run StartMeshcat() it successfully displays 'INFO:drake:Meshcat listening for connections at http://localhost:7000' but I can't reach my localhost, it gives the 'ERR_CONNECTION_REFUSED' error on any browser. I tried the generic solutions available on web regarding wsl localhost connection problems but none of them worked. What may be the cause? Thanks in advance!

Site rendering broken on iOS and Mac OSX after moving to JDK 10 and JSF 2.3 with WildFly

Good day
Issue below is solved on WildFly 13 by disabling HTTP/2 (while still keeping TLS for HTTPS).
Even the non effected browser and system combos (all the non Apple stuff) seem to load much faster now.
Follow instructions from this post on how to disable HTTP/2:
https://developer.jboss.org/message/984394?et=watches.email.thread#984394
From the ./jboss-cli.sh cli just run:
/subsystem=undertow/server=default-server/https-listener=https:write-attribute(name=enable-http2,value=false)
And reload / restart the server. All devices render perfectly and fast.
I am leaving the below if somebody else runs into a similar error.
I updated my code and POM file to use the Java EE 8 dependencies for WildFly 13 based on the WildFly 13 BOM POM and the #Balusc JSF 2.3 Java EE 8 kickoff sample application.
So I set it to use:
JSF 2.3.5.Final
OmniFaces 3.1
PrimeFaces 6.2.7
On desktop (all operating systems with all of the latest browsers) the site works 100% and the war is deployed in half the time.
However the site fails to render correctly on my iPhone. I tried all browsers installable from the app store, and the one that looks the nearest to correct is Firefox.
However even with Firefox I can't get pass the login screen.
On Android and all non Apple based products the site works without any error logs.
Is anybody aware of issues rendering JSF 2.3 on Apple based products?
Any pointers on what to look for, add or change will be most appreciated.
See below for log file info:
The initial error only triggered from iOS / Mac OSX is an UNDERTOW error with OmniFaces info (we are using TLS for HTTPS, but before moving all to JSF 2.3 everything worked 100% with zero errors or warnings in logs)
2018-07-30 09:09:18,741 ERROR [io.undertow] (default task-3078) UT005085: Connection io.undertow.server.protocol.http2.Http2ServerConnection#7e55834 for exchange HttpServerExchange{ GET /edsnext/javax.faces.resource/omnifaces.js.xhtml request {accept=[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8], accept-language=[en-us], :authority=[edsnext.megchemsa.com:62543], accept-encoding=[gzip, deflate], :path=[/edsnext/javax.faces.resource/omnifaces.js.xhtml?ln=omnifaces&v=3.1], user-agent=[Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1], :scheme=[https], cookie=[JSESSIONID=U5X9u-A83bccAnpA1XUnEFzmngqI9iDJwuIiU_Qo], :method=[GET], Referer=[https://edsnext.megchemsa.com:62543/edsnext/], upgrade-insecure-requests=[1], Host=[edsnext.megchemsa.com:62543]} response {Expires=[Mon, 30 Jul 2018 09:57:18 GMT], ETag=[W/"5933-1532705069245"], Last-Modified=[Fri, 27 Jul 2018 15:24:29 GMT], Set-Cookie=[JSESSIONID=U5X9u-A83bccAnpA1XUnEFzmngqI9iDJwuIiU_Qo.edsnext; path=/edsnext], Content-Type=[application/javascript], Date=[Mon, 30 Jul 2018 07:09:18 GMT], :status=[200]}} was not closed cleanly, forcibly closing connection
Then the following PrimeFaces resource not found warnings (and login page is rendered incorrectly on iOS)
2018-07-30 09:09:21,056 WARNING [javax.enterprise.resource.webcontainer.jsf.application] (default task-3091) JSF1064: Unable to find or serve resource, fa/fontawesome-webfont.eot, from library, primefaces.
2018-07-30 09:09:21,056 WARNING [javax.enterprise.resource.webcontainer.jsf.application] (default task-3084) JSF1064: Unable to find or serve resource, fonts/lato-regular-webfont.svg, from library, primefaces-omega.
2018-07-30 09:09:21,056 WARNING [javax.enterprise.resource.webcontainer.jsf.application] (default task-3082) JSF1064: Unable to find or serve resource, fa/fontawesome-webfont.ttf, from library, primefaces.
2018-07-30 09:09:21,056 WARNING [javax.enterprise.resource.webcontainer.jsf.application] (default task-3100) JSF1064: Unable to find or serve resource, fa/fontawesome-webfont.svg, from library, primefaces.
2018-07-30 09:09:21,056 WARNING [javax.enterprise.resource.webcontainer.jsf.application] (default task-3103) JSF1064: Unable to find or serve resource, fonts/lato-bold-webfont.svg, from library, primefaces-omega.
2018-07-30 09:09:21,056 WARNING [javax.enterprise.resource.webcontainer.jsf.application] (default task-3091) : java.nio.channels.ClosedChannelException
EDIT: Added log file info pointing to UNDERTOW errors followed by lots of PrimeFaces missing resources.
EDIT 2:
Ok, I tested this with:
Server side:
CentOS 7.5 all updated
Oracle JDK 10.1
WildFly 13.0.0.Final
JSF 2.3.5.SP1
PrimeFaces 6.2.7
OmniFaces 3.1
The following setups renders the site perfectly with zero errors or warning at debug level:
CentOS GNOME 7.5 Chromium
CentOS GNOME 7.5 Firefox Developer Edition
Windows 10 Chrome
Windows 10 Firefox Developer Edition
Android Studio Nexus 5 AVD APK 28 Chrome
Samsung Galaxy S7 Chrome
Samsung Galaxy S7 Firefox
All browsers installable from the Apple app store including Safari fails to render the site. All have the UNDERTOW error.
Tested with Mac OSX - latest updated version - also fails with the UNDERTOW error.
I logged a bug report with Apple. Problem is though that a substantial amount of users are effected by this due to having to access the Web app via their iPhone or iPad.
What else can I do to expedite this?
To resolve this error disable HTTP/2 on WildFly 13 with:
Follow instructions from this post on how to disable HTTP/2:
https://developer.jboss.org/message/984394?et=watches.email.thread#984394
From the ./jboss-cli.sh cli just run:
/subsystem=undertow/server=default-server/https-listener=https:write-attribute(name=enable-http2,value=false)
Restart / reload the server and all is well.

Starting https Jenkins server on 127.0.0.1

Embarrassingly enough I am one page into Jenkins Continuous Integration Cookbook and I'm already stuck on this command:
Java -jar jenkins.war --httpsPort=8443 --httpPort=-1
On my Mac, this throws up with:
Running from: /home/NAThompson/jenkins/war/target/jenkins.war
webroot: $user.home/.jenkins
Feb 22, 2015 7:37:24 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Using one-time self-signed certificate
Feb 22, 2015 7:37:24 PM winstone.Logger logInternal
INFO: Winstone shutdown successfully
Feb 22, 2015 7:37:24 PM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.IOException: Failed to start a listener: winstone.HttpsConnectorFactory
at winstone.Launcher.spawnListener(Launcher.java:209)
at winstone.Launcher.<init>(Launcher.java:149)
at winstone.Launcher.main(Launcher.java:354)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at Main._main(Main.java:293)
at Main.main(Main.java:98)
Caused by: java.lang.NoClassDefFoundError: sun/security/x509/CertAndKeyGen
at winstone.HttpsConnectorFactory.start(HttpsConnectorFactory.java:100)
at winstone.Launcher.spawnListener(Launcher.java:207)
... 8 more
Caused by: java.lang.ClassNotFoundException: sun.security.x509.CertAndKeyGen
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 10 more
What can I do to get around this? As extraneous info, the server starts just fine using http.
This looks like a known issue with trying to use HTTPS directly from the jenkins.war. Some have suggested running Jenkins from within Tomcat and letting Tomcat handle SSL (I've not tried this personally yet, however).
I fixed this issue for myself by setting Jenkins to run using Java 7. I am running it as a service so I did this by editing the jenkins-runner.sh file. I added the following line:
export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home"
and then modified the last two lines to:
echo $JAVA_HOME/bin/java $javaArgs -jar "$war" $args
exec $JAVA_HOME/bin/java $javaArgs -jar "$war" $args
I also made sure to set the httpsKeyStore and httpsKeyStorePassword properties after creating a selfsigned certificate (instructions here under Using SSL: Installing and Configuring Jenkins)
First, I would not recommend running Jenkins within a Mac environment unless of course you are developing for the Mac/IOS. In that case, you have an error with Java installation and/or configs. The real error is ClassNotFoundException: sun.security.x509.CertAndKeyGen. You should verify your version of Java with the requirements of the version of Jenkins you are using. I read a few blog articles that hinted that it is likely a discrepancy with the Java version you (Mac OS) is running.
Secondly, it is highly unlikely that you will ever use Mac for your CI needs. You should really look into running local virtual machines that will mimic your CI environments. You can get started easily with open source tools like VirtualBox and Vagrant.

Grails deployment error

I've manage to deploy my Grails app on my local pc on Tomcat and database is on MySql server but I cant manage to do it on remote server in the same enviroment.
This is the begining of stacktrace:
java.lang.UnsupportedClassVersionError: org/codehaus/groovy/grails/plugins/springsecurity/SpringSecurityUtils : Unsupported major.minor version 51.0 (unable to load class org.codehaus.groovy.grails.plugins.springsecurity.SpringSecurityUtils)
Either use the same JVM version on the server as you are using on your local pc OR use a higher version on the server. Typically, that should solve your problem
You're compiling and running with different JVM versions.
The JDK version on your computer should be the same that is installed on the remote server.

YourKit Profile On Remote Grails App

I am trying to track down a memory leak that I am having with a Grails application and am using the Yourkit Profiler, but am running into a problem.
I have the Grails application running in Tomcat6 on the Production server and have unpacked the YourKit profiler and ran it according to the documentation using sudo bin/yjp.sh -attach, but I am getting the error:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.yourkit.Main$2.run(a:19)
Caused by: com.yourkit.runtime.PresentableException: com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
at com.yourkit.ui.s.n.a(a:170)
at com.yourkit.ui.s.n.a(a:176)
at com.yourkit.ui.s.j.a(a:250)
at com.yourkit.c.do(a:73)
at com.yourkit.Main0.entry(a:274)
... 5 more
I am using YourKit v10 and am on an Ubuntu 11.04 server. Any ideas?
It looks like I had to run as the user running the container. Changing sudo bin/yjp.sh -attach to sudo -u tomcat6 bin/yjp.sh -attach worked.
You need to have the Attach API working before you can continue:
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
See the JVisualVM FAQ - their troubleshooting can be used here too.

Resources