realrolfje/anonimatron

Cannot generate demo configuration file

jawira opened this issue · 2 comments

Describe the bug

Cannot create config example

To Reproduce

Steps to reproduce the behavior:

  1. Download anonimatron
  2. Unzip & enter anonimatron dir
  3. Execute command: ./anonimatron.sh -configexample
  4. An exception raises

Expected behavior

I expected to see a config example, not an exception.

Logs, screenshots

$ ./anonimatron.sh -configexample

Supported Database URL formats:
Jdbc URL format                                              By Driver
jdbc:oracle:oci8:@[SID]                                      oracle.jdbc.driver.OracleDriver
jdbc:sybase:Tds:[HOST]:[PORT]/[DB]                           net.sourceforge.jtds.jdbc.Driver
jdbc:sqlserver://[HOST]:[PORT][;DatabaseName=[DB]]           com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc:oracle:oci:@[SID]                                       oracle.jdbc.driver.OracleDriver
jdbc:postgresql://[HOST]:[PORT]/[DB]                         org.postgresql.Driver
jdbc:oracle:thin:@[HOST]:[PORT]:[SID]                        oracle.jdbc.driver.OracleDriver
jdbc:microsoft:sqlserver://[HOST]:[PORT][;DatabaseName=[DB]] com.microsoft.sqlserver.jdbc.SQLServerDriver

Anonimatron will try to autodetect drivers which are
stored in the lib directory. Add you driver there.


Demo configuration file for Anonymatron 1.15:
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 @3e849b9e
        at org.exolab.castor.xml.BaseXercesJDK5Serializer.<init>(BaseXercesJDK5Serializer.java:53)
        at org.exolab.castor.xml.XercesJDK5Serializer.<init>(XercesJDK5Serializer.java:27)
        at org.exolab.castor.xml.XercesJDK5XMLSerializerFactory.getSerializer(XercesJDK5XMLSerializerFactory.java:29)
        at org.exolab.castor.xml.util.XMLParserUtils.getSerializer(XMLParserUtils.java:261)
        at org.castor.xml.AbstractInternalContext.getSerializer(AbstractInternalContext.java:321)
        at org.exolab.castor.xml.Marshaller.configureSerializer(Marshaller.java:457)
        at org.exolab.castor.xml.Marshaller.setWriter(Marshaller.java:404)
        at org.exolab.castor.xml.Marshaller.<init>(Marshaller.java:358)
        at com.rolfje.anonimatron.configuration.Configuration.getDemoConfiguration(Configuration.java:83)
        at com.rolfje.anonimatron.Anonimatron.printDemoConfiguration(Anonimatron.java:147)
        at com.rolfje.anonimatron.Anonimatron.main(Anonimatron.java:51)

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Java version :

openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment (build 17.0.1+12-Ubuntu-120.04)
OpenJDK 64-Bit Server VM (build 17.0.1+12-Ubuntu-120.04, mixed mode, sharing)

Additional context

I followed documentation instructions, but since I'm new to Java I suppose I have to install something else but I don't know what.

Hello Jawira, you did everything right. Thanks for reporting this. It looks like Anonimatron is running into a security feature of Java 9 and higher, the error message points to a missing export. I'll have to look into why that happens and how I can solve it, I guess more people must be running into this.

Do you by any chance have an option to install an older version of Java? (both Oracle and OpenJDK should work).

After reading your answer I realized I forgot to tell you I'm using Ubuntu on a "Windows WSL2" environment.

Anyway, I downgraded to OpenJDK 8 and now I'm able to see demo config file. Thank you 👍