users@jaxb.java.net

RE: ClassCastException: ...jaxb.impl.runtime.DefaultJAXBContextImpl

From: Karr, David <david.karr_at_wamu.net>
Date: Fri, 22 Oct 2004 08:13:45 -0700

For a little more information, it's clear that my current error is a
classloader problem, because the line it appears to be failing on is
trying to cast the "DefaultJAXBContextImpl" object to a "JAXBContext",
but that's the direct superclass of "DefaultJAXBContextImpl".

Also, that bug id I quoted is referring to a ClassNotFoundException, not
a ClassCastException, so it might not be exactly the same problem.

> -----Original Message-----
> From: Karr, David
>
> I'm using JAXB 1.0.1, with WebLogic 8.1SP3.
>
> I have two EARs deployed to a domain. The first EAR has
> several ejb and web modules. One of the web modules
> registers a set of mbeans. In the other EAR, a servlet
> invokes a method on one of the mbeans, whose return type is a
> JAXB-generated type. The method in the mbean tries to create
> a JAXBContext to unmarshal a stream into a JAXB object
> hierarchy and then returns the top-level object.
>
> I've struggled through a handful of classloader-related
> issues in the single call to create the JAXBContext. To get
> past the issues with finding the jaxb.properties file and the
> ContextFactory_1_0_1 class, I passed an instance of a simple
> custom ClassLoader to the
> JAXBContext.newInstance() method, which just uses the current
> context class loader to load the named entities.
>
> My current error looks like this (the package hierarchy
> specific to my project is elided):
>
> java.lang.ClassCastException:
> ...jaxb.impl.runtime.DefaultJAXBContextImpl
> at
> javax.xml.bind.JAXBContext.newInstance(Ljava.lang.String;Ljava
> .lang.Clas
> sLoader;)Ljavax.xml.bind.JAXBContext;(JAXBContext.java:281)
>
> I haven't been able to figure out why this is happening.
>
> I noticed in the Sun bug database, bug #4860458 is titled
> "ClassNotFoundException:
> org.oasis.ubl.order.impl.runtime.DefaultJAXBContextImpl". It
> says the bug was found in release 1.0.1, and it is fixed. It
> doesn't say which release the bug is fixed in.
>
> Does anyone know about this problem, or the bug report I
> refer to? It would be useful to know what was found to be
> wrong, whether there is a workaround in v1.0.1, and what
> release the bug was fixed in.
>
> ---------------------------------------------------------------------
> 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