users@jaxb.java.net

Re: java.lang.IllegalAccessError occured during JAXBContext.newInstance("package name");

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Wed, 3 Dec 2008 10:17:46 +0100

Call the JAXBContext.newInstance with an additional ClassLoader
argument, set to the initial ClassLoader you obtain by calling
Thread.getcurrentTrhead().getContextClassLoader().

Session beans are loaded by a special class loader which does
not provide access to all the things in your initial class path.

-W


On Wed, Dec 3, 2008 at 3:20 AM, yankings <yankings_at_hotmail.com> wrote:

>
> Hi,
>
> i am try to perfrom marshalling by JAXB 2.1.6, the marshalling process is
> carried out inside a session bean, exception is throw when the system
> reached this statement JAXBContext context =
> JAXBContext.newInstance("package name");
>
> The exception message is :
> java.lang.IllegalAccessError: tried to access class
> javax.xml.bind.ContextFinder from class javax.xml.bind.JAXBContext
> oracle.oc4j.rmi.OracleRemoteException: java.lang.IllegalAccessError: tried
> to access class javax.xml.bind.ContextFinder from class
> javax.xml.bind.JAXBContext
>
> I try to switch the marshalling process to a standalone java class (just
> have void main method), the process works fine, can someone help me above
> this?
>
> Thanks A lot!!
>
> --
> View this message in context:
> http://www.nabble.com/java.lang.IllegalAccessError-occured-during-JAXBContext.newInstance%28%22package-name%22%29--tp20805508p20805508.html
> Sent from the java.net - jaxb users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>