svendiedrichsen / jollyday

Jollyday - A holiday API
Other
189 stars 114 forks source link

java.lang.IllegalStateException: Cannot create manager class de.jollyday.impl.DefaultHolidayManager #77

Closed gitburr closed 6 years ago

gitburr commented 6 years ago

Hello,

I have been using jollyday in my project for a couple of years now without incident. However, during a recent test when attempting to upgrade our OS from ubuntu 16.04 LTS to 18.04 LTS, we ran into the following issue:

Receive the following exception when executing on ubuntu 18.04 LTS, although the exact same code works when running under ubuntu 16.04 LTS:

java.lang.IllegalStateException: Cannot create manager class de.jollyday.impl.DefaultHolidayManager
at de.jollyday.caching.HolidayManagerValueHandler.instantiateManagerImpl(HolidayManagerValueHandler.java:61)
(...)

Please see the following for a complete test case and further info which illustrates the error:

https://github.com/gitburr/jollyTest

Thank you in advance for your help.

gitburr commented 6 years ago

Sorry, this can be disregarded.

For anyone else who may run into this, after I did some more digging I discovered that installing openjdk-8-jdk on ubuntu 18.04 LTS does not update the symlinks for the default jre ("java") as it does for the jdk ("javac"). The jre was still pointing to java 11 by default. It seems the jaxB dependencies are not included with java 11, and hence the failure.

Here was the fix:

# update-java-alternatives -s java-1.8.0-openjdk-amd64 
update-alternatives: error: no alternatives for jaotc
update-alternatives: error: no alternatives for jdeprscan
update-alternatives: error: no alternatives for jhsdb
update-alternatives: error: no alternatives for jimage
update-alternatives: error: no alternatives for jlink
update-alternatives: error: no alternatives for jmod
update-alternatives: error: no alternatives for jshell
update-alternatives: error: no alternatives for mozilla-javaplugin.so
update-java-alternatives: plugin alternative does not exist: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so
# java -version
openjdk version "1.8.0_171"