Java RuntimeException when writing synonyms.xml
Opened this issue · 2 comments
Thank you for Anonimatron.
Describe the bug
Java Exception:
Writing Synonyms to /Users/*****/anonimatron-1.15/synonyms.xml ...Exception in thread "main" java.lang.RuntimeException: Could not instantiate serializer com.sun.org.apache.xml.internal.serialize.XMLSerializer: java.lang.IllegalAccessException: class org.exolab.castor.xml.BaseXercesJDK5Serializer cannot access class com.sun.org.apache.xml.internal.serialize.XMLSerializer (in module java.xml) because module java.xml does not export com.sun.org.apache.xml.internal.serialize to unnamed module @544ff9ef
synonyms.xml is a zero length file
The database target database does appear to be anonymised successfully. I'm using SQL Server.
Desktop (please complete the following information):
- OS: MacOS 12.5.1
[~/dev/anonimatron-1.15]$ java --version
java 17.0.4.1 2022-08-18 LTS
Java(TM) SE Runtime Environment (build 17.0.4.1+1-LTS-2)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.4.1+1-LTS-2, mixed mode, sharing)
I appreciate this may be an issue with Castor (I have failed to find a fix) but I'm not clear why other Anonimatron users have experienced it, maybe that will help me find a correction, any pointers welcome.
Thank you.
Hi Matt, this seems to be an issue caused by the incompatibility of the old (Castor) code with the new, more strict access checking in newer versions of Java. As a matter of fact I currently have the same issue when running the unittests of anonimatron on Java 20. This problem is not unique to Anonimatron or Castor: https://stackoverflow.com/questions/53633788/java-lang-illegalaccesserror-cannot-access-class-because-module-does-not-export
I don't have an immediate fix for this, other than the workaround of using an older version of Java. Currently Anonimatron support Java 8, I am considering to no longer support that version so that I can bump some dependencies to a higher version and at the same time solve this issue.
Thanks for reporting this, I'll keep this issue open until this is solved.
Thank you Rolfje.
Actually I think this is not a blocking issue for us as I think we won't have the need to repeat Anonimatron runs with matching output, but I'll watch the issue.