jaxb-api
jaxb-api copied to clipboard
JAXBContext.newInstance(Class..., ClassLoader) missing?
Hi folks, I need to define my own Classloader, and because in the JAXB-API is no method like: public static JAXBContext newInstance(Class..., ClassLoader)
and only one like: public static JAXBContext newInstance(String, ClassLoader)
is it possible to add a newInstance(Class..., ClassLoader)-method or could somebody explain me, what I have to do, the following example code will run:
JAXBContext ctx; //works perfectly for me! ctx = JAXBContext.newInstance(HelloWorld.class);
//says: "package org.mypackage" doesnt contain ObjectFactory.class or jaxb.index" ctx = JAXBContext.newInstance("org.mypackage");
//says: "package org.mypackage" doesnt contain ObjectFactory.class or jaxb.index" ctx = JAXBContext.newInstance(HelloWorld.class.getPackage().toString());
//something like this would be nice ctx = JAXBContext.newInstance(HelloWorld.class, this.getClass().getClassLoader());
is it possible to resolve the "package org.mypackage" doesnt contain ObjectFactory.class or jaxb.index" automatically or to provide an newInstance(Class..., ClassLoader)-method, because this would fit the best and make the create the JAXBContext.newInstance()-process more chubbier.
regards Flori
Environment
Operating System: All Platform: All
Affected Versions
[2.2]
- Issue Imported From: https://github.com/javaee/jaxb-v2/issues/600
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: @glassfishrobot
@glassfishrobot Commented Reported by florianbachmann
@glassfishrobot Commented Was assigned to snajper
@glassfishrobot Commented This issue was imported from java.net JIRA JAXB-600