Details
-
Task
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
2022 Week 02-04 (from Jan 10), 2022 Week 05-07 (from Jan 31)
-
5
-
NEW
-
NEW
Description
To avoid the following runtime error when using JDK17 and running the kie-dmn-validation tests:
java.lang.NullPointerException: Cannot invoke "java.lang.reflect.Method.invoke(Object, Object[])" because "com.sun.xml.bind.v2.runtime.reflect.opt.Injector.defineClass" is null at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.inject(Injector.java:311) at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.inject(Injector.java:97) at com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:87) at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:179) at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:285) at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.<init>(SingleElementLeafProperty.java:92) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:128) at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:181) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:514) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:331) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:139) at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1156) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:165) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:251) at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:240) at javax.xml.bind.ContextFinder.find(ContextFinder.java:363) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:691) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:632) at org.kie.dmn.validation.dtanalysis.mcdc.MCDC2TCKGenerator.mcdc2tck(MCDC2TCKGenerator.java:62)
it is required that the provided-scope dependency:
<dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId> <scope>provided</scope> </dependency>
version to be at least >=2.3.1
(and not 2.3.0 as from parent BOM definition)
Please note this affect a provided scope dependency only when running the tests.
This implies there is no compilation requirement/direct-link between the kie-dmn code and this jaxb dependency; the problem is only a run-time issue, in this case exhibited by the test leveraging JAXB, and manifesting the problem.