redis-field-engineering/redis-connect-dist

Investigate including JAXB-runtime jar

bjbredis opened this issue · 1 comments

Using MacOS with both JRE 11 and 14.

Scenario:

  1. Start the RedisCDC JobManager with ./startup.sh.
  2. The following ClassNotFoundException is encountered.
javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.
 - with linked exception:
[java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory]
	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:232)
	at javax.xml.bind.ContextFinder.find(ContextFinder.java:375)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:691)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:632)
	at com.ivoyant.cdc.mapper.MapperProvider.processMapperConfig(MapperProvider.java:36)
	at com.ivoyant.cdc.mapper.MapperProvider.<init>(MapperProvider.java:29)
	at com.ivoyant.cdc.mapper.MapperProvider.<clinit>(MapperProvider.java:22)
	at com.ivoyant.cdc.connector.debezium.producers.RDBEventProducer.init(RDBEventProducer.java:84)
	at com.ivoyant.cdc.connector.redis.LJobClaimerImpl.claimJob(LJobClaimerImpl.java:54)
	at com.ivoyant.cdc.connector.redis.JobClaimerImpl.run(JobClaimerImpl.java:111)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at javax.xml.bind.ServiceLoaderUtil.nullSafeLoadClass(ServiceLoaderUtil.java:92)
	at javax.xml.bind.ServiceLoaderUtil.safeLoadClass(ServiceLoaderUtil.java:125)
	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:230)
	... 15 more

Potential Workaround:

  • Adding jaxb-runtime-2.3.0.jar to the RedisCDC lib/ directory resolved the ClassNotFoundException.
  • Per this link: jaxb-api is required for compilation, jaxb-runtime is required at runtime.

Thanks for reporting the issue and explaining the scenario. The existing RedisCDC framework and MSSQL connector has been compiled with Java 1.8 and tested with java8 JRE. We will make sure that RedisCDC works with >java8 JRE in the future release.