question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.ExceptionInInitializerError on Ubuntu after Java Upgrade

See original GitHub issue

The command line tools for Jasypt 1.9.3 started throwing java.lang.ExceptionInInitializerError after a recent system upgrade. I’m guessing it’s because of the java version, but other packages were upgraded at the same time.

The upgraded server is now running openjdk JRE 1.8.0_265. The example below shows that it won’t encrypt anything.

ubuntu@ip-10-0-1-21:/usr/local/bin/jasypt/bin$ ./encrypt.sh input=test password=test

----ENVIRONMENT-----------------

Runtime: Private Build OpenJDK 64-Bit Server VM 25.265-b01



----ARGUMENTS-------------------

input: test
password: test



----ERROR-----------------------

java.lang.ExceptionInInitializerError

This sever, which hasn’t been upgraded is running openjdk JRE 1.8.0_252 and encryption works there.

ubuntu@ip-10-1-1-103:/usr/local/bin/jasypt/bin$ ./encrypt.sh input=test password=test

----ENVIRONMENT-----------------

Runtime: Private Build OpenJDK 64-Bit Server VM 25.252-b09



----ARGUMENTS-------------------

input: test
password: test



----OUTPUT----------------------

iBVgRSj3NIfi0iPPyYaqIA==

I’m trying to figure out how to downgrade the Java version on Ubuntu, but I’d appreciate any other advice as to what might be done about this as well.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
woozoo73commented, Mar 17, 2021

I’ve found that you don’t need to remove all the jar files from lib directory. Removing icu4j-3.4.4.jar is enough.

Thanks. Worked for me.

1reaction
nkitiyakaracommented, Aug 6, 2020

Okay, probably final thought here as I think I have a workaround. After seeing my little test application working, I went back and moved all the jar files in ./lib to another directory (state demonstrated below) and the encrypt.sh script started working again. Something in one of those jars must be throwing an error after some system update (java or something else), preventing the normal encryption from working. All jars were originally installed from https://github.com/jasypt/jasypt/releases/download/jasypt-1.9.3/jasypt-1.9.3-dist.zip

ubuntu@ip-10-0-1-21:/usr/local/bin/jasypt/bin$ ls -alF ../lib
total 148
drwxr-xr-x 2 root root   4096 Aug  6 15:13 ./
drwxr-xr-x 5 root root   4096 Aug  6 15:13 ../
-rw-r--r-- 1 root root 142255 Aug  6 15:13 jasypt-1.9.3.jar
ubuntu@ip-10-0-1-21:/usr/local/bin/jasypt/bin$ ls -alF ../tmp
total 6732
drwxr-xr-x 2 root root    4096 Aug  6 15:13 ./
drwxr-xr-x 5 root root    4096 Aug  6 15:13 ../
-rw-r--r-- 1 root root   61829 Sep 24  2019 commons-logging-1.2.jar
-rw-r--r-- 1 root root 3233439 Sep 24  2019 icu4j-3.4.4.jar
-rw-r--r-- 1 root root  142255 Sep 24  2019 jasypt-1.9.3.jar
-rw-r--r-- 1 root root  748409 Sep 24  2019 jasypt-1.9.3-javadoc.jar
-rw-r--r-- 1 root root   74953 Sep 24  2019 jasypt-1.9.3-lite.jar
-rw-r--r-- 1 root root  235508 Sep 24  2019 jasypt-1.9.3-sources.jar
-rw-r--r-- 1 root root   14728 Sep 24  2019 jasypt-acegisecurity-1.9.3.jar
-rw-r--r-- 1 root root   53020 Sep 24  2019 jasypt-acegisecurity-1.9.3-javadoc.jar
-rw-r--r-- 1 root root   17233 Sep 24  2019 jasypt-acegisecurity-1.9.3-sources.jar
-rw-r--r-- 1 root root   78271 Sep 24  2019 jasypt-hibernate3-1.9.3.jar
-rw-r--r-- 1 root root  356479 Sep 24  2019 jasypt-hibernate3-1.9.3-javadoc.jar
-rw-r--r-- 1 root root  115393 Sep 24  2019 jasypt-hibernate3-1.9.3-sources.jar
-rw-r--r-- 1 root root   44178 Sep 24  2019 jasypt-hibernate4-1.9.3.jar
-rw-r--r-- 1 root root  188246 Sep 24  2019 jasypt-hibernate4-1.9.3-javadoc.jar
-rw-r--r-- 1 root root   60413 Sep 24  2019 jasypt-hibernate4-1.9.3-sources.jar
-rw-r--r-- 1 root root   44295 Sep 24  2019 jasypt-hibernate5-1.9.3.jar
-rw-r--r-- 1 root root  187949 Sep 24  2019 jasypt-hibernate5-1.9.3-javadoc.jar
-rw-r--r-- 1 root root   59932 Sep 24  2019 jasypt-hibernate5-1.9.3-sources.jar
-rw-r--r-- 1 root root   17603 Sep 24  2019 jasypt-spring2-1.9.3.jar
-rw-r--r-- 1 root root   74582 Sep 24  2019 jasypt-spring2-1.9.3-javadoc.jar
-rw-r--r-- 1 root root   20208 Sep 24  2019 jasypt-spring2-1.9.3-sources.jar
-rw-r--r-- 1 root root   49354 Sep 24  2019 jasypt-spring31-1.9.3.jar
-rw-r--r-- 1 root root   85487 Sep 24  2019 jasypt-spring31-1.9.3-javadoc.jar
-rw-r--r-- 1 root root   46287 Sep 24  2019 jasypt-spring31-1.9.3-sources.jar
-rw-r--r-- 1 root root   50393 Sep 24  2019 jasypt-spring3-1.9.3.jar
-rw-r--r-- 1 root root  103864 Sep 24  2019 jasypt-spring3-1.9.3-javadoc.jar
-rw-r--r-- 1 root root   49375 Sep 24  2019 jasypt-spring3-1.9.3-sources.jar
-rw-r--r-- 1 root root   47894 Sep 24  2019 jasypt-spring4-1.9.3.jar
-rw-r--r-- 1 root root   79157 Sep 24  2019 jasypt-spring4-1.9.3-javadoc.jar
-rw-r--r-- 1 root root   44248 Sep 24  2019 jasypt-spring4-1.9.3-sources.jar
-rw-r--r-- 1 root root   15198 Sep 24  2019 jasypt-springsecurity2-1.9.3.jar
-rw-r--r-- 1 root root   54096 Sep 24  2019 jasypt-springsecurity2-1.9.3-javadoc.jar
-rw-r--r-- 1 root root   17599 Sep 24  2019 jasypt-springsecurity2-1.9.3-sources.jar
-rw-r--r-- 1 root root   20772 Sep 24  2019 jasypt-springsecurity3-1.9.3.jar
-rw-r--r-- 1 root root   71930 Sep 24  2019 jasypt-springsecurity3-1.9.3-javadoc.jar
-rw-r--r-- 1 root root   22153 Sep 24  2019 jasypt-springsecurity3-1.9.3-sources.jar
-rw-r--r-- 1 root root   15487 Sep 24  2019 jasypt-springsecurity4-1.9.3.jar
-rw-r--r-- 1 root root   47542 Sep 24  2019 jasypt-springsecurity4-1.9.3-javadoc.jar
-rw-r--r-- 1 root root   14233 Sep 24  2019 jasypt-springsecurity4-1.9.3-sources.jar
-rw-r--r-- 1 root root   13146 Sep 24  2019 jasypt-wicket13-1.9.3.jar
-rw-r--r-- 1 root root   48014 Sep 24  2019 jasypt-wicket13-1.9.3-javadoc.jar
-rw-r--r-- 1 root root   12613 Sep 24  2019 jasypt-wicket13-1.9.3-sources.jar
-rw-r--r-- 1 root root   11020 Sep 24  2019 jasypt-wicket15-1.9.3.jar
-rw-r--r-- 1 root root   30294 Sep 24  2019 jasypt-wicket15-1.9.3-javadoc.jar
-rw-r--r-- 1 root root    9450 Sep 24  2019 jasypt-wicket15-1.9.3-sources.jar

Read more comments on GitHub >

github_iconTop Results From Across the Web

Arduino and Ubuntu 18.10: java.lang.ExceptionInInitializerError
I can confirm your issue with arduino from the repository. But version from umake works as expected. – N0rbert. Oct 21, 2018 at...
Read more >
"[SOLVED] ubuntu Exception in thread main java.lang ...
I have downloaded rapidminer-5.2.008.zip and unzip it. I use Ubuntu 12.04 Cannot start rapidminer: $ cd apps/rapidminer/
Read more >
How to Resolve Java.lang.ExceptionInInitializerError In Java?
We can resolve the java.lang.ExceptionInInitializerError by ensuring that static initializer block of classes does not throw any Runtime ...
Read more >
java.lang.ExceptionInInitializerError com.sun.tools.javac.code ...
After changing environment variable JAVA_HOME to jdk8 home dir, this error disappear. Share.
Read more >
Bug ID: JDK-8132459 ExceptionInInitializerError from 'java
Command to reproduce: LANG=zh_CN.GB18030 java -version Error message: Error occurred during initialization of VM java.lang.ExceptionInInitializerError at ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found