-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JAXBContext.newInstance(Class..., ClassLoader) missing? #243
Labels
Comments
@glassfishrobot Commented |
@glassfishrobot Commented |
@glassfishrobot Commented |
|
antoniosanct
added a commit
to antoniosanct/jaxb-api
that referenced
this issue
Feb 17, 2024
…reaking backward-compatibility Signed-off-by: Antonio Santos Izaguirre <antoniosanct@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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]
The text was updated successfully, but these errors were encountered: