users@jaxb.java.net

Re: [JAXB 2.0] Failed to initialize JAXP 1.3 DatatypeFactory class

From: Kohsuke Kawaguchi <kohsuke.kawaguchi_at_sun.com>
Date: Fri, 06 Jan 2006 10:42:26 -0800

mark_at_javector.com wrote:
> When I try to create a context:
>
> JAXBContext jc =
>
> JAXBContext.newInstance("com.example.oms:com.example.css");
>
> I get a runtime exception:
>
> Failed to initialize JAXP 1.3 DatatypeFactory classCaused by:
> ...
> java.lang.ClassNotFoundException:
> com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl
> ...
>
> I used to be able to get around this by putting ${java.home}/rt.jar on the
> classpath. However, now when I do that, I am getting this error:
>
> java.lang.IllegalAccessError: class sun.reflect.GeneratedConstructorAccessor5
> cannot access its superclass sun.reflect.ConstructorAccessorImpl
>
> What is the proper way to set the JAXP 1.3 DatatypeFactory implementation and
> put it on the classpath?

I hope JAXP web page http://jaxp.dev.java.net/ has more resource on
this, but I believe the correct installation procedure for JAXP is to
either:

        1) put it on $JAVA_HOME/lib/endorsed
        2) use -Djava.endorsed.dirs=/path/to/jaxp/lib on VM startup.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com