This content has been marked as final. Show 3 replies
Even we are facing similar problem.
We have a JAR which contains JAXB classes apart from other classes.
Now, a test java class which tries to instantiate JAXBContext and unmarshall XML files.
This class is also loaded to DB.
But it throws the same error as mentioned above, while JAXBContext.newInstance("<package>").
Appreciate any help to resolve this.
A few years ago I developed a server side framework similar to Struts for DBPrism CMS, at that time I utilized the JAXB framework for instantiating the action form class (user provided).
The code which instantiate the class based on arguments defined the XML file was:
The trick was to get the user's class-loader from the user connected session (note Bootstrap class) because Controller class is at DBPrism schema and Bootstrap is loaded at Scott for example.
With this trick JAXB frameworks work as expected.
At this [cms.xml|http://dbprism.cvs.sourceforge.net/viewvc/dbprism/cms-2.1/tasks/cms.xml?revision=1.19&view=markup] file there is code for making a new Jar with only the missing classes of the framework because if upload directly the xml.jar to the OJVM it will override some native classes of XMLType implementation (target unpack-jaxb-classes).
Note that the above Ant file also have the target for uploading Bootstrap class to the user schema.
Hope this help, Marcelo.
I have the same problem loading JAXB in OracleVM with loadjava tool. In Java 1.6, JAXB is part of "core" Java. But in Java 1.5, it is part of the Java Web Services Developer Pack, so all of its JARs have to be loaded: activation.jar, jaxb-api-2.0-SNAPSHOT.jar, jaxb-impl-1.0.5.jar, jaxb-impl-2.0-SNAPSHOT.jar, jsr173_api-1.0.jar. No matter what order I try to use loadjava on these JARs, classes are always skipped because of additional dependencies.
The result is that my classes produced by the jvc utility, which "import javax.xml.bind.*", cannot be resolved (regardless of whether or not I use I use loadjava -resolve or -genmissing flags). ORA-29541: class XXX could not be resolved
Has ANYONE had success using JAXB in the OracleVM in 11gR2? If so, please provide a loadjava script.