users@jaxb.java.net

Re: WebSphere 6.1

From: Kenny MacLeod <kennym_at_kizoom.com>
Date: Mon, 02 Oct 2006 22:29:30 +0100

 From what I recall from diagnosing this a few months ago, the root
exception is a java.lang.LinkageError. Something in the classloader is
objecting to finding QName where it shouldn't be, I think.

I've only seen it happen with the EA versions of JAXB-RI, where one of
the JARs in the distro (jsr173, I think) had a copy of QName in it.
Later distros fixed the problem. The O.P. said he was using RI 2.0.2,
but if QName is lurking about somewhere else in their environment, it
might still trigger this problem.

It's an awkward one to get to the cause of, I only managed to get the
LinkageError by using Eclipse's debugger to try and grub around in the
bowels of the RI. On a surface glance, the LinkageError doesn't seem to
show itself.

Kohsuke Kawaguchi wrote:
> Kenny MacLeod wrote:
>> That stack trace looks familiar :)
>>
>> If I remember correctly, this is caused by having more than one copy
>> of javax.xml.namespace.QName in your classpath.
>
> Thanks.
>
> But how does it happen? All QNames are created from the source code like
> "new QName(...)" and never via reflection.
>
> So even if there are multiple copies, shouldn't the JAXB RI only see one
> (of many) QName definition, and hence shouldn't that work?
>
> The reason I'm asking this is that if this is a common enough problem, I
> could put some defensive logic to check that and report more friendly
> error. But I don't know how to do that, unless I know how the failure
> occurs.
>