jpmml/jpmml-evaluator

No class def found for jakarta/xml/bind/JAXBContext

paranjapeved15 opened this issue · 3 comments

Similar to this issue #246 I am seeing the following error. I am upgrading from jpmml-evaluator 1.5.15 to 1.6.4.

jakarta/xml/bind/JAXBContext
java.lang.NoClassDefFoundError: jakarta/xml/bind/JAXBContext
at org.jpmml.model.JAXBUtil.getContext(JAXBUtil.java:106)
at org.jpmml.evaluator.LoadingModelEvaluatorBuilder.load(LoadingModelEvaluatorBuilder.java:151)
at org.jpmml.evaluator.LoadingModelEvaluatorBuilder.load(LoadingModelEvaluatorBuilder.java:138)
at org.jpmml.evaluator.LoadingModelEvaluatorBuilder.load(LoadingModelEvaluatorBuilder.java:126)

@vruusmann as you suggested here #245, I tried to use jpmml-evaluator-moxy as well as metro but to no good.

@vruusmann in one of the above issues, you mentioned that this issue would be fixed in 1.6.4, am I missing something else?

Closing as exact duplicate of #245 and #246.

java.lang.NoClassDefFoundError: jakarta/xml/bind/JAXBContext

Please fix your classpath.

You mentioned that this issue would be fixed in 1.6.4,

There is no issue per se - it's all about setting up your classpath correctly. Your choice, whether you want to go with the Glassfish Metro impl, or the EclipseLink MOXy one.

The one thing that I could do was adding the LoadingModelEvaluatorBuilder#setJAXBContext(JAXBContext) method. If you have multiple Jakarta XML Bind impls on you classpath, then you can specify which one do you want to use.

Can you please help me with specifying the correct xml binds impls?
Specifically, could you please specify which versions of the jakarta xml binds I need with jpmml-evaluator-metro 1.6.4? Could you also show me how I can specify which version to use in java code?