Closed felixxxxxs closed 1 year ago
I have the same issue. Forcing using old java 8 is solving the issue. So please at least update the written compatibility from JAVA > 10 to the dedicated Versions the tool is able tun run in.
Problem solved by upgrade the jaxb dependency. Fixed in main
The problem still persists:
➜ XR java -jar validationtool-1.4.2-standalone.jar -s scenarios.xml -h ubl.xml
KoSIT Validator version 1.4.2
Loading scenarios from file:///Users/mac/tmp/XR/scenarios.xml
Using repository null
Dez. 27, 2022 11:15:59 PM com.sun.xml.bind.v2.runtime.reflect.opt.Injector <clinit>
SCHWERWIEGEND: null
java.security.PrivilegedActionException: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String,[B,int,int,java.lang.ClassLoader,java.security.ProtectionDomain)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:573)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.<clinit>(Injector.java:166)
at com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:51)
at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:157)
at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:255)
at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:64)
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:484)
at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:99)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:150)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:493)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:310)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:109)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1142)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:144)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:268)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:171)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:129)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:307)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:478)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:435)
at de.kosit.validationtool.impl.ConversionService.initialize(ConversionService.java:143)
at de.kosit.validationtool.impl.ConversionService.initialize(ConversionService.java:133)
at de.kosit.validationtool.impl.ConversionService.initialize(ConversionService.java:117)
at de.kosit.validationtool.impl.ConversionService.getJaxbContext(ConversionService.java:89)
at de.kosit.validationtool.impl.ConversionService.readXml(ConversionService.java:180)
at de.kosit.validationtool.config.ConfigurationLoader.loadScenarios(ConfigurationLoader.java:171)
at de.kosit.validationtool.config.ConfigurationLoader.build(ConfigurationLoader.java:139)
at de.kosit.validationtool.cmd.Validator.processActions(Validator.java:173)
at de.kosit.validationtool.cmd.Validator.mainProgram(Validator.java:105)
at de.kosit.validationtool.cmd.CommandLineApplication.mainProgram(CommandLineApplication.java:92)
at de.kosit.validationtool.cmd.CommandLineApplication.main(CommandLineApplication.java:60)
Caused by: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String,[B,int,int,java.lang.ClassLoader,java.security.ProtectionDomain)
at java.base/java.lang.Class.getMethod(Class.java:2277)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector$3.run(Injector.java:170)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector$3.run(Injector.java:166)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
... 34 more
Cannot invoke "java.lang.reflect.Method.invoke(Object, Object[])" because "com.sun.xml.bind.v2.runtime.reflect.opt.Injector.defineClass" is null
##############################
# Validation failed! #
##############################
➜ XR java -version
openjdk version "19.0.1" 2022-10-18
OpenJDK Runtime Environment Homebrew (build 19.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 19.0.1, mixed mode, sharing)
➜ XR sw_vers
ProductName: macOS
ProductVersion: 12.6.2
BuildVersion: 21G320
➜ XR
well, fixed in 1.5.0, not in 1.4.2.
Thanks, it now works with v1.5.0. However, I had to specify an absolute path, which should be avoided. See No. 3 here: https://github.com/itplr-kosit/validator-configuration-xrechnung/issues/80
Using standalone validator version 1.4.2 With Java 17:
If this error is because of Java 17, the "standalone" build should definitely be updated to support it :)
Running the validator produces the following output: