Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jaxb-impl-dev] Implementation of JAXB-API has not been found by my Eclipse plugin

Hi All,

In my Eclipse plugin I need to unmarshall some XML. It was all good while I was on Java-8. Since I moved to Java-11 I faced the necessity of adding an external implementation of JAXB-API. This is the point where I'm stuck.

When I try to create a JAXB context I get an exception " java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory ".
	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.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 my.code

The Internet tells me I have to add some maven dependencies but it won't work for me because I'm using Tycho. So, I tried to add com.sun.xml.bind to the Require-Bundle section of my plugin's MANIFEST.MF
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.14.0",
 jakarta.xml.bind;bundle-version="2.3.3",
 com.sun.xml.bind;bundle-version="2.3.3"

and to the target definition.
<unit id="com.sun.xml.bind" version="2.3.3.v20201118-1818"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20201130205003/repository/"/>

This did not change the result despite the fact that com.sun.xml.bind artifact resides in my RCP's plugins folder.

What I did wrong or what I should do to be able to use JAXB with my plugin?

I do this on win7 and win10.
openjdk version "11.0.10" 2021-01-19
The RCP-application is Trace Compass.

Thanks!

P.S. A link to my StackOverflow question with details: https://stackoverflow.com/questions/66894011

--
Best regards,
Ivan Grinenko
Software Engineer
Auriga




Back to the top