Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jakarta.xml.bind.JAXBException No Found Exception #234

Closed
lvty opened this issue Dec 14, 2021 · 3 comments
Closed

jakarta.xml.bind.JAXBException No Found Exception #234

lvty opened this issue Dec 14, 2021 · 3 comments

Comments

@lvty
Copy link

lvty commented Dec 14, 2021

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!

@vruusmann
Copy link
Member

vruusmann commented Dec 14, 2021

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
Copy link
Author

lvty commented Dec 14, 2021

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.

@vruusmann
Copy link
Member

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.

vruusmann added a commit that referenced this issue Jan 19, 2022
Following the switch from Java XML Binding to Jakarta XML Binding,
the standalone 'org.jpmml:pmml-evaluator' dependeny lost the ability
to parse PMML documents (including on Java 8); it needs to be
accompanied by a specialized JAXB runtime dependency.
The 'org.jpmml:pmml-evaluator-metro' dependency is the preferred
substitution for project's internal needs (eg. unit testing), because
it features the minimum number of transitive dependencies (API +
implementation).

See #234
vruusmann added a commit to jpmml/jpmml-model that referenced this issue Feb 18, 2022
The main 'pmml-model' module should import Jakarta XML Binding
and Jackson annotations in order to prevent numerous Java compiler and
Javadoc warnings in downstream projects.

See jpmml/jpmml-evaluator#234
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants