users@jaxb.java.net

Re: jaxb2-reflection problem

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 14 May 2007 17:20:59 -0700

I'm curious why you are not seeing the source code line number
information. That would be really useful for tracking down a problem.

Hunor Bartha wrote:
> Hi,
>
> I am having trouble using the jaxb2-reflection library to read the
> annotation information from my generated jaxb pojos. When i try to
> create the RuntimeTypeInfoset, using
> JAXBModelFactory.create(MyClass.class) it throws the following exception:
>
> Exception in thread "main" java.lang.NullPointerException
> at
> org.jvnet.jaxb.reflection.runtime.reflect.Accessor$FieldReflection.optimize(Unknown
> Source)
> at
> org.jvnet.jaxb.reflection.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.<init>(Unknown
> Source)
> at
> org.jvnet.jaxb.reflection.runtime.reflect.TransducedAccessor.get(Unknown
> Source)
> at
> org.jvnet.jaxb.reflection.model.impl.RuntimeClassInfoImpl.calcTransducer(Unknown
> Source)
> at
> org.jvnet.jaxb.reflection.model.impl.RuntimeClassInfoImpl.getTransducer(Unknown
> Source)
> at
> org.jvnet.jaxb.reflection.model.impl.RuntimeClassInfoImpl.link(Unknown
> Source)
> at org.jvnet.jaxb.reflection.model.impl.ModelBuilder.link(Unknown
> Source)
> at
> org.jvnet.jaxb.reflection.model.impl.RuntimeModelBuilder.link(Unknown
> Source)
> at org.jvnet.jaxb.reflection.JAXBModelFactory.create(Unknown Source)
> at org.jvnet.jaxb.reflection.JAXBModelFactory.create(Unknown Source)
> at org.jvnet.jaxb.reflection.JAXBModelFactory.create(Unknown Source)
>
> I discovered that the problem is caused by a field that has a
> @XmlElementRefs() annotation, like:
>
> @XmlElementRefs({
> @XmlElementRef(name = "name1", type = JAXBElement.class),
> @XmlElementRef(name = "name2", type = JAXBElement.class)
> })
>
> Does anybody has a quick solution?
>
> Thanks,
>
> hunor
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com