jcryptool / core

JCrypTool Core Plug-ins
https://www.cryptool.org
Eclipse Public License 1.0
163 stars 43 forks source link

XStream, conseq. Alphabet store et al. cease to work on java 16.0.1.hs-adpt #256

Open simlei opened 2 years ago

simlei commented 2 years ago

In my local Eclipse RCP dev environment, java 16.0.1 from formerly AdoptOpenJDK, now Temurin (see https://sdkman.io/jdks), installed via sdkman, I get the following exception from the alphabet store which relies on xstream (which we ship in v1.3.1):

!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.ExceptionInInitializerError: Cannot access defaults field of Properties
    at com.thoughtworks.xstream.converters.collections.PropertiesConverter.<clinit>(PropertiesConverter.java:46)
    at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:647)
    at com.thoughtworks.xstream.XStream.<init>(XStream.java:445)
    at com.thoughtworks.xstream.XStream.<init>(XStream.java:385)
    at com.thoughtworks.xstream.XStream.<init>(XStream.java:342)
    at org.jcryptool.crypto.classic.alphabets.tools.AlphabetPersistence.saveAlphabetsToXML(AlphabetPersistence.java:40)
    at org.jcryptool.crypto.classic.alphabets.tools.AlphabetStore.storeAlphabets(AlphabetStore.java:379)
    at org.jcryptool.crypto.classic.alphabets.tools.AlphabetStore.processAlphabetsCreation(AlphabetStore.java:201)
    at org.jcryptool.crypto.classic.alphabets.tools.AlphabetStore.init(AlphabetStore.java:180)
    at org.jcryptool.core.operations.alphabets.AlphabetsManager.<init>(AlphabetsManager.java:53)
    at org.jcryptool.core.operations.alphabets.AlphabetsManager.getInstance(AlphabetsManager.java:64)
    at org.jcryptool.crypto.classic.alphabets.preferences.AlphabetsPreferencePage.prepare(AlphabetsPreferencePage.java:120)
    at org.jcryptool.crypto.classic.alphabets.preferences.AlphabetsPreferencePage.createContents(AlphabetsPreferencePage.java:99)

(appears e.g. when opening the "Cryptography" > "Alphabets" subsection in the Preferences window)

Switching to Java 11.0.14 "fixes" this. As it seems now, just installing a JDK / JRE that works with xstream sufficiently covers all of our dev workflow without this issue getting in the way. Still, xstream is used quite often in our plugins, so this issue can't be ignored forever.

Further investigation needed: