Skip to content
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

Open
Tomas-Kraus opened this issue Feb 11, 2009 · 4 comments · May be fixed by #296
Open

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

Tomas-Kraus opened this issue Feb 11, 2009 · 4 comments · May be fixed by #296
Assignees
Labels
4.1 enhancement New feature or request Major Priority

Comments

@Tomas-Kraus
Copy link
Contributor

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
Copy link
Contributor Author

@glassfishrobot Commented
Reported by florianbachmann

@Tomas-Kraus
Copy link
Contributor Author

@glassfishrobot Commented
Was assigned to snajper

@Tomas-Kraus
Copy link
Contributor Author

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

@Tomas-Kraus
Copy link
Contributor Author

@lukasj lukasj transferred this issue from eclipse-ee4j/jaxb-ri May 19, 2022
@lukasj lukasj added enhancement New feature or request and removed Component: spec labels May 19, 2022
antoniosanct added a commit to antoniosanct/jaxb-api that referenced this issue Feb 17, 2024
…reaking backward-compatibility

Signed-off-by: Antonio Santos Izaguirre <[email protected]>
@lukasj lukasj linked a pull request Feb 18, 2024 that will close this issue
@lukasj lukasj added the 4.1 label Feb 18, 2024
@lukasj lukasj linked a pull request Feb 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.1 enhancement New feature or request Major Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants