jaxb-api icon indicating copy to clipboard operation
jaxb-api copied to clipboard

JAXBContext.newInstance(Class..., ClassLoader) missing?

Open Tomas-Kraus opened this issue 16 years ago • 4 comments

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]

Tomas-Kraus avatar Feb 11 '09 03:02 Tomas-Kraus

  • Issue Imported From: https://github.com/javaee/jaxb-v2/issues/600
  • Original Issue Raised By:@glassfishrobot
  • Original Issue Assigned To: @glassfishrobot

Tomas-Kraus avatar Sep 21 '18 15:09 Tomas-Kraus

@glassfishrobot Commented Reported by florianbachmann

Tomas-Kraus avatar Feb 11 '09 03:02 Tomas-Kraus

@glassfishrobot Commented Was assigned to snajper

Tomas-Kraus avatar Feb 11 '09 03:02 Tomas-Kraus

@glassfishrobot Commented This issue was imported from java.net JIRA JAXB-600

Tomas-Kraus avatar Apr 24 '17 12:04 Tomas-Kraus