My context :
BND (bndtools with Eclipse IDE) ;
OSGI (-runfw: org.eclipse.osgi;version='[3.16.100.v20201030-1916,3.16.200.v20210226-1447]') ;
runee: JavaSE-1.8
in bnd.launch file :
-runbundles: \ org.apache.felix.gogo.command;version='[1.1.2,1.1.3)',\ org.apache.felix.gogo.runtime;version='[1.1.4,1.1.5)',\ org.apache.felix.gogo.shell;version='[1.1.4,1.1.5)',\ org.apache.commons.commons-fileupload;version='[1.4.0,1.4.1)',\ org.apache.commons.commons-io;version='[2.8.0,2.8.1)',\ org.apache.felix.webconsole;version='[4.6.0,4.6.1)',\ org.apache.felix.http.jetty;version='[4.1.6,4.1.7)',\ org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\ org.apache.felix.scr;version='[2.1.24,2.1.25)',\ org.eclipse.equinox.cm;version='[1.5.0,1.5.1)',\ org.eclipse.equinox.console;version='[1.4.300,1.4.301)',\ org.eclipse.equinox.device;version='[1.1.100,1.1.101)',\ org.eclipse.osgi.services;version='[3.10.0,3.10.1)',\ org.eclipse.osgi.util;version='[3.6.0,3.6.1)',\ ch.qos.logback.classic;version='[1.2.3,1.2.4)',\ ch.qos.logback.core;version='[1.2.3,1.2.4)',\ org.apache.felix.logback;version='[1.0.2,1.0.3)',\ slf4j.api;version='[1.7.30,1.7.31)',\ com.sun.activation.jakarta.activation;version='[2.0.1,2.0.2)',\ jakarta.xml.bind-api;version='[3.0.1,3.0.2)',\ com.sun.xml.bind.jaxb-osgi;version='[3.0.1,3.0.2)'
- No use of any POM.xml file at all
When I launch the application, I get a
jakarta.xml.bind.JAXBException: Implementation of Jakarta XML Binding-API has not been found on module path or classpath. - with linked exception: [java.lang.ClassNotFoundException: org.glassfish.jaxb.runtime.v2.ContextFactory] at jakarta.xml.bind.ContextFinder.newInstance(ContextFinder.java:255) at jakarta.xml.bind.ContextFinder.newInstance(ContextFinder.java:243) at jakarta.xml.bind.ContextFinder.find(ContextFinder.java:407) at jakarta.xml.bind.JAXBContext.newInstance(JAXBContext.java:691) at jakarta.xml.bind.JAXBContext.newInstance(JAXBContext.java:632)
If I add org.glassfish.jaxb.runtime;version='[3.0.1,3.0.2)'
to the runbundles list, it doesn't change anything (same exception).
Then if I add -runpath: org.glassfish.jaxb.runtime;version='[3.0.1,3.0.2)'
to the bnd.launch file : it doesn't change anything either (same exception).
What did I did wrong ?? Thanks
Are you running on Java 1.9 or later? (The error message talks about module path.) The problem might be that JAXB is no longer exported from the JVM in later versions. This will the class loading of glassfish to fail without telling the underlying reason sometimes.
You can add
-runvm -v:class
to get more information about the class loading.