users@jaxb.java.net

RE: classloaders and jaxb.properties..

From: Malachi de Aelfweald <malachid_at_temporal-wave.com>
Date: Wed, 12 Nov 2003 08:38:10 -0800

Try doing:
        jc = JAXBContext.newInstance( "posb.operations.jaxb.wxml");

instead. I have that working in a JAR via JNLP just fine. The problem
you
MIGHT be having is that Thread (ie, your current thread) is not loaded
from
the jar, but from rt.jar....? Try just getting rid of the classloader
portion.

Malachi

-----Original Message-----
From: Andrew.Ferguson_at_arm.com [mailto:Andrew.Ferguson_at_arm.com]
Sent: Wednesday, November 12, 2003 8:27 AM
To: users_at_jaxb.dev.java.net

hi,

 I'm currently obtaining a JAXB context with the code below

      jc = JAXBContext.newInstance( "posb.operations.jaxb.wxml",
Thread.currentThread().getContextClassLoader() );

and this works fine when the class runs as-is. My problem is that I've
been
trying to jar the whole application (including the .properties files :)
and
have it loaded by a custom classloader. Other resources are loading fine
but JAXB is giving an error message:

 javax.xml.bind.JAXBException: javax.xml.bind.JAXBException: Unable to
locate jaxb.properties for package posb.operations.jaxb.wxml

My understanding was that since I'm not setting the context classloader
for
the thread in which the code above runs, the context classloader will
default to whichever classloader loaded the class that contains the code
being run (ie the custom classloader). I've tried changing this to

      jc = JAXBContext.newInstance( "posb.operations.jaxb.wxml");

but this doesn't work either.

What mechanism is JAXBContext using to search for jaxb.properties?

thanks,
Andrew
ps. is the JAXB source code available to download?






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net