Unexpected Exception in open_reader() - java

I am using pdftk library in ubuntu 16.04 to merge several pdf. Everything is OK, when I installed a SSL certificate I get this error :
Error: Unexpected Exception in open_reader()
java.lang.RuntimeException: java.lang.RuntimeException: error instantiating
default socket factory: java.security.KeyManagementException:
java.security.KeyStoreException: java.io.FileNotFoundException:
/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre/lib/security/cacerts (No such file or
directory)
at javax.net.ssl.SSLSocketFactory$ErrorSocketFactory.createSocket(libgcj.so.16)
at gnu.java.net.protocol.http.HTTPConnection.getSocket(libgcj.so.16)
at gnu.java.net.protocol.http.HTTPConnection.getOutputStream(libgcj.so.16)
at gnu.java.net.protocol.http.Request.dispatch(libgcj.so.16)
at gnu.java.net.protocol.http.HTTPURLConnection.connect(libgcj.so.16)
at gnu.java.net.protocol.http.HTTPURLConnection.getInputStream(libgcj.so.16)
at java.net.URL.openStream(libgcj.so.16)
at pdftk.com.lowagie.text.pdf.RandomAccessFileOrArray.<init>(pdftk)
at pdftk.com.lowagie.text.pdf.PRTokeniser.<init>(pdftk)
at pdftk.com.lowagie.text.pdf.PdfReader.<init>(pdftk)
at pdftk.com.lowagie.text.pdf.PdfReader.<init>(pdftk)
Caused by: java.lang.RuntimeException: error instantiating default socket
factory: java.security.KeyManagementException: java.security.KeyStoreException:
java.io.FileNotFoundException: /usr/lib/jvm/java-1.5.0-gcj-5-
amd64/jre/lib/security/cacerts (No such file or directory)
at javax.net.ssl.SSLSocketFactory.getDefault(libgcj.so.16)
at javax.net.ssl.HttpsURLConnection.getDefaultSSLSocketFactory(libgcj.so.16)
at javax.net.ssl.HttpsURLConnection.getSSLSocketFactory(libgcj.so.16)
after several research I find that the problem comes from the https link.
When I use a link from a pdf file whith https It doesn't work For example :
sudo pdftk https://www.fifa.com/mm/document/fanfest/magazine/magazine09-06p.3en_3465.pdf output 1805.pdf
Could you please help me fix this error.

I had the same issue and played around with switching between installed java versions, but with no effect.
when searching further I found this site:
https://wilransz.com/pdftk-on-ubuntu-18-04/
Creating a symlink like this
sudo ln -s /snap/pdftk/current/usr/bin/pdftk /usr/bin/pdftk
fixed the issue!

The problem is that you have an incomplete or broken GCJ Java installation. The "cacerts" file that should be present at ...
/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre/lib/security/cacerts
... is missing. According to Ubuntu package search, in Ubuntu 16.04, the file should be part of the libgcj16 package. So try installing that package using apt.
The real issue is that the PDFTK is relying on the old GCJ Java toolchain. GCJ has barely been maintained, and has finally been deprecated and dropped from the GCC code base ... as of GCC 7.1.
The GCJ toolchain was removed from RedHat in RHEL 7 (back in 2011!), and it was finally removed from Ubuntu in Ubuntu 18.04.
Unfortunately the maintainers for PDFTK have not made available a port for Oracle / OpenJDK versions of Java. In fact, there don't appear to have been changes in the upstream distribution from PDFLabs since 2014 ... so maybe you should be looking for an alternative.
(Or use a fork: see https://askubuntu.com/questions/1028522/how-can-i-install-pdftk-in-ubuntu-18-04-bionic. However, think carefully about the various problems that might arise if you depend on an unofficial / unsupported fork of a "dead" project.)
See also:
Java JRE vs GCJ

Related

How can I run eclipse properly? [duplicate]

I have formatted my Mac due to some storage issues. Before this, I used Eclipse in a proper way. Now i have installed the JDK
Then, i have installed Java
Until now everything seems to be correct but when I open the Eclipse installer...
What can I do to fix this? I need to work with this the soon as possible.
Thanks
Eclipse on macOS will not start with Java 14 installed, this is being tracked in Eclipse bug 561273.
Installing Java 8 as well does not help. You need to remove the Java 14 install. You could use the Java 13.0.2 release instead.
Eclipse have determined that the root cause of this issue is a change in Java 14 which is described in this bug report JDK-8238225. The fix for this should be in Java 14.0.1
Update: Eclipse runs fine with Oracle Java 14.0.1 so the issue has been fixed.
I also asked this question which was closed, that's why I answer what I have found out: Eclipse will not install on Mac OS Catalina 10.15.4, saying the above error message
Failed to create the Java Virtual Machine.
Deinstalling jdk and install an older one wouldn't help on its own because Eclipse is refusing to install in the first place (as mentioned above). What I have done:
i´ve installed an JDK with boost (you can try several, mine worked with Version 13)
I edited the installer:
Download the dmg file
convert the dmg-file with "hdiutil convert /dev/disk3s1 -format UDRW -o devimage"
mount the converted dmg-file with: "hdiutil attach -owners on devimage.dmg -shadow"
Edit the /Volumes/Eclipse/Eclipse.app/Contents/Info.plist: there is a section which is commented and there you can try the jdk version. You have to give the full path to the java executable, for example:
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home/bin/java</string>
Then my eclipse started from the (already) mounted Eclipse image without complaining
I had the same issue myself a while back. In your Eclipsepedia it provided an example of what the eclipse.ini file looks like when your trying to specify a JVM. So just change the eclipse.ini file and then make sure that you have all of the correct documents in that path to match the example.

Server App Engine Standard at localhost failed to start

From eclipse, I created a Google App Engine Standard project and tried to Run it on local App Engine. It is not starting and throwing the below errors -
java.lang.NullPointerException
at java.base/java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011)
at java.base/java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006)
at java.base/java.util.Properties.put(Properties.java:1316)
at java.base/java.util.Collections$CheckedMap.put(Collections.java:3636)
at com.google.appengine.tools.development.SharedMain.setTimeZone(SharedMain.java:219)
at com.google.appengine.tools.development.SharedMain.postServerActions(SharedMain.java:188)
at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:398)
at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:45)
at com.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:257)
at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:248)
Also note that I haven't made any changes to the project. It's the default that gets created.
This is likely an issue with your jdk version. What does javac -version report back? I run into the same stack trace with version 12. Switching to 1.8 works.
On MacOS, this answer helps: How to set or change the default Java (JDK) version on OS X?
Other platforms should have similar ways to switch versions.
This looks to be a JDK12 issue - it seems JDK12 is restricting the system properties exposed to programs, I've run into a similar issue with the OS version before.
I've reported it to Google, you can star it so they feel the weight of the matter: https://issuetracker.google.com/issues/140787205

NoClassDefFoundError and NullPointerException when opening a project with PhpStorm on OS X Sierra

Recently installed PhpStorm 2017.2.4 on my Mac Pro (Sierra 10.12.6), Java version is (9+181).
Whenever I try to open a project, PhpStorm hangs.
I took a look at the log file situated in /Library/Logs/PhpStorm2017.2.
There are several NoClassDefFoundError happening, with a slice of NullPointerException.
Here are a few excerpts:
java.lang.NoClassDefFoundError: com/apple/eawt/AppEvent$AboutEvent
java.lang.NoClassDefFoundError: com/apple/eawt/OpenURIHandler
java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
java.lang.NoClassDefFoundError: Could not initialize class com.intellij.credentialStore.kdbx.KdbxKt
java.lang.NullPointerException at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.b(ToolWindowManagerImpl.java:1800)
java.lang.NullPointerException at com.intellij.codeInsight.daemon.impl.DaemonListeners$MyProfileChangeListener.a(DaemonListeners.java:519)
I tried to change the target java version in the info.plist configuration file inside the PhpStorm package.
I also followed these instructions in order to be able to start the application.
Just to check I also installed Webstorm, which worked perfectly out of the box.
After doing some research, it looks like no one else is having this problem. I really need some inspiration, some crazy idea to try.
PS: I uploaded the log file here if anyone feels like wading through it.
Found a better solution, you can install PhpStorm with homebrew
homebrew cask install phpstorm
Worked like a charm.
I'm leaving the old answer, just in case someone needs this kind of information.
Ooookay, I got it working. But that was not pretty.
So for some reason PhpStorm is not able to use its own bundled JDK. It's trying to use the system's default JDK, which is Java 9 for me.
Therefore i did something a bit extreme, I replaced the lib folder in the system's JDK by a symbolic link pointing to the jre lib folder inside the Phpstorm.app package
sudo ln -s /Applications/PhpStorm.app/Contents/jdk/Contents/Home/jre/lib /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/lib
Needless to say that you should not use this method if you have other applications using the system's JDK.
Thanks to LazyOne, whose comment gave me the 'aha!' moment.
PS: if anyone needs this information, I also had to give executing permissions to fsnotifier in order to be able to browse files within the IDE
chmod 744 /Applications/PhpStorm.app/Contents/bin/fsnotifier
I had this with Intelli-J when upgrading the jdk it runs on to 11.
I changed the jdk it runs on back down to 8 by following the instructions here:
https://intellij-support.jetbrains.com/hc/en-us/articles/206544879-Selecting-the-JDK-version-the-IDE-will-run-under
Might also need this link too for the config files locations
https://intellij-support.jetbrains.com/hc/en-us/articles/206544519

An internal error occurred during: "Publishing to WAS 8559 ..."

I got following error while starting the server.
An internal error occurred during: "Publishing to WAS 8559 ...".
Could not initialize class com.ibm.ws.ffdc.FFDCFilter
Eclipse Java EE IDE for Web Developers Version: Mars.1 Release (4.5.1)
IBM WebSphere Application Server for Developers 8.5.5.9
I tried some methods posted in stackoverflow. But it doesn't work.
e.g.could-not-initialize-class-com-ibm-ws-ffdc-ffdcfilter
1.added this entry in eclipse.ini file "-vm C:\Program Files\IBM\WebSphere\AppServer\java\jre\bin\javaw.exe", restarted eclipse and server;
2.Windows->Preferences->Java->Installed JREs
Do you have any suggestion about this problem?
I followed MrSimpleMind's solution and this worked for me. I copied the com.ibm.ws.orb_8.5.0.jar from
C:\Program Files(x86)\IBM\Websphere\AppServer\bin\ProfileManagement\eclipse64 to C:\lib. The only thing I did differently and just to be on the safe side was to update the eclipse.ini in all locations where I found it. I shut down the eclipse, restarted and the publish worked after this change. Thanks MrSimpleMind
There are some solutions, like upgrading Eclipse, changing to IBM JRE etc.
But the issue is related to the ORB jar that is missing.
The FFDCFilter error can be solved as described in "RMI Connection Type" found in this technote IBM Support page - swg21999577
The com.ibm.ws.orb jar is missing and that causes the FFDCFilter issue. It is the result of using the non-IBM JDK. The reason why this jar is not included as part of WDT is because this jar conflicts with the IBM JDK case.
Solution
copy the orb jar, I think your version might be com.ibm.ws.orb_8.5.0.jar (look in your AppServer folder) to e.g. c:\lib
Add the following line at end of your eclipse.ini -Djava.endorsed.dirs=C:\lib
(You could also copy the orb jar into your java jre endorsed library folder.)
See forum post with more information.

Informix CSDK install failing

I'm trying to install the Informix CSDK to get the drivers for an ODBC connection using Perl and DBD::ODBC. When running the ./installclientsdk, I'm getting the following error:
Initializing InstallShield Wizard........
Launching InstallShield Wizard........erified.
The wizard cannot continue because of the following error: could not load wizard specified in /wizard.inf (104)
I've read that only open-jdk is available on Ubuntu 11.10 so I went and installed the java version, which is where I'm at now. If I debug, I get:
QJMLException: (error code = 3002; message="java.lang.ClassNotFoundException: sun.beans.editors.BoolEditor")
I've been following this post:
http://ubuntuforums.org/showthread.php?t=1483193
But so far no luck on getting JRE running or the CSDK installed. Any suggestions on this one?
Thanks!
There should be a JVM included with the software, and the installer should use it if it cannot find an appropriate alternative. The question then is whether the JVM bundled with CSDK can run on Ubuntu 11.10. It is certified for Redhat and SuSE, I believe.
Which version of CSDK are you trying to install? Which kernel version and GNU C Library version are in Ubuntu 11.10?
I'm not keen on the '...erified' (as opposed to ...verified) part of the message; it is ominous when such simple messages are not displaying correctly.
I've not installed Informix on Ubuntu sufficiently recently to have any useful recollections of how well it worked. I don't remember any problems, but that could just mean I'm old and forgetful.

Categories