Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Moxy Java11
Moxy Java11 [message #1804244] Thu, 21 March 2019 07:28 Go to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
Hi

I have a RCP applcation using MOXy to parse complex XML, the annotated classes are generated by XJC, and the package contains a ObjectFactory and a jaxb.properties pointing to MOXy.

The application works with Java8, but starting the application with Java11, i get this exception:

java.lang.RuntimeException: javax.xml.bind.JAXBException
 - with linked exception:
[Exception [EclipseLink-50000] (Eclipse Persistence Services - 2.7.4.v20190115-ad5b7c6b2a): org.eclipse.persistence.exceptions.JAXBException
Exception Description: The context path mypackage contains no ObjectFactory or jaxb.index, no external metadata was found in properties Map, and sessions.xml was found or was invalid.
Internal Exception: Exception [EclipseLink-7095] (Eclipse Persistence Services - 2.7.4.v20190115-ad5b7c6b2a): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The sessions.xml resource [sessions.xml] was not found on the resource path.  Check that the resource name/path and classloader passed to the SessionManager.getSession are correct.  The sessions.xml should be included in the root of the application's deployed jar, if the sessions.xml is deployed in a sub-directory in the application's jar ensure that the correct resource path using "/" not "\" is used.]


My target platform contains:
org.eclipse.persistence.moxy_2.7.4....jar
javax.activation-1.2.0.jar
jaxb-api-2.3.1.jar
jaxb-osgi-2.3.2.jar

I use Multi-Release: true to be able to handle Java8 vs. Java9+.
In the main MANIFEST.FM i require org.eclipse.persistence.moxy.
In the versions/9/OSGI-INF/MANIFEST.FM I add the import packages: com.sun.xml.bind.v2, javax.xml.bind

To start the application in the Eclipse run configuration dialog, i switch the JRE Java8 vs Java11, and in the plugins tab, i remove (J8) or add (J11) com.sun.xml.bind.jaxb-osgi (jaxb-osgi.jar) to make it startable.

My question:
Is this the right way to go?
What is this exception and how to solve?

regards
Frank
Re: Moxy Java11 [message #1804246 is a reply to message #1804244] Thu, 21 March 2019 08:02 Go to previous messageGo to next message
Lukas JungmannFriend
Messages: 36
Registered: November 2013
Location: Prague, Czech Republic
Member
jaxb-osgi-2.3.2.jar requires 'jakarta.xml.bind-api-2.3.2.jar' (formerly 'jaxb-api') and 'jakarta.activation-1.2.1.jar' and so should moxy. Does updating dependencies fix the problem?

for more details about new maven coordinates and/versions of particular technologies, see https://wiki.eclipse.org/New_Maven_Coordinates and https://wiki.eclipse.org/Eclipse_GlassFish_5.1_Components_Release_Tracker
Re: Moxy Java11 [message #1804247 is a reply to message #1804246] Thu, 21 March 2019 08:23 Go to previous messageGo to next message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
Hello Lukas,

thanks a lot for your reply.

I update the target platform with those jars from the eclipselink zip file:
removed: javax.activation-1.2.0.jar
removed: jaxb-api-2.3.1.jar
added: jakarta.activation.jar
added: jakarta.xml.bind-api.jar
keep: jaxb-osgi-2.3.2.jar
keep: org.eclipse.persistence.moxy_2.7.4....jar

The runtime behavior is unchanged:
Java8 OK
Java11 (11.0.2) the exception from above.

Frank

Re: Moxy Java11 [message #1804249 is a reply to message #1804247] Thu, 21 March 2019 08:27 Go to previous message
Frank Benoit is currently offline Frank BenoitFriend
Messages: 179
Registered: July 2009
Senior Member
...

here are plugins selected when starting with J11:
index.php/fa/35100/0/

Frank
Previous Topic:Exception ResultSet using eclipseLink @NamedStoredProcedureQuery
Next Topic:ReadOnly object query causes NPE in hashCode
Goto Forum:
  


Current Time: Wed Apr 24 21:36:20 GMT 2024

Powered by FUDForum. Page generated in 0.02552 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top