jpmml/jpmml-evaluator

jakarta.xml.bind.JAXBException No Found Exception

Closed this issue · 3 comments

lvty commented

Hello master,
when i use java8 and project maven version of 1.6.0, I found the idea platform throwing a class no found exception, just like: jakarta.xml.bind.JAXBException/jakarta.xml.bind.Unmarshaller/jakarta.xml.bind.ValidationEventHandler.
Does these class(prefix startsWith jakarta) are relocated in the module? And how can i solve this problem?
Snipaste_2021-12-14_19-38-36
Best wishes!

One of the big changes between JPMML-Evaluator 1.5.X and 1.6.X is that the Java XML Bindings (java.xml.bind.*) library was replaced with the Jakarta XML Bindings (jakarta.xml.bind.*) library.

What's your target Java SE version? The Java XML Binding classes are included in Java SE 8. The Jakarta XML Bind classes are not native to the Java/JVM platform, and always have to be included manually.

The recommended way is simply to include the org.jpmml:pmml-evaluator-metro:1.6.X dependency into your project (note the -metro suffix!).

This looks like a documentation bug to me, because the README.md file currently suggests that Java SE 8 users can keep using the org.jpmml:pmml-evaluator:1.6.X dependency as-is. It doesn't work, because Java SE 8 does not include Jakarta XML Bind classes, they still need to be included explicitly.

lvty commented

Hello master,
The version of my Java SE version is Java SE 8. I have retryed again and solved the problem by adding a pmml-evaluator-metro pom file. The README.md file confused me last time.
Thanks.

The README.md file confused me last time.

The README.md file for the 1.6.0 version gives bad advice for Java SE 8 users. You should be following the "Java SE 9 and newer" advice at all times.

I will fix the documentation shortly. Will add a couple of more code examples highlighting some 1.6.X features. For example, the org.dmg.pmml.FieldName class has been removed, and all your arguments and results maps should be String-keyed now.