users@jaxb.java.net

Re: jaxb-reflection Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/istack/FinalArrayList

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 05 Jun 2007 16:42:16 -0700

I should have rebundled istack-commons-runtime.jar to the
jaxb2-reflection jar. I just made that change so in the nightly builds
it should be fixed tonight.

You can also put jaxb-impl.jar in the classpath to pick up the class
from there in the mean time.

Raul Selas wrote:
> Hi all!!
>
> Im trying jaxb2-reflection library... and I receive the next exception:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> com/sun/istack/FinalArrayList
> at org.jvnet.jaxb.reflection.model.impl.ClassInfoImpl.getProperties(Unknown
> Source)
> at
> org.jvnet.jaxb.reflection.model.impl.RuntimeClassInfoImpl.getProperties(Unknown
> Source)
> at org.jvnet.jaxb.reflection.model.impl.ModelBuilder.getClassInfo(Unknown
> Source)
> at org.jvnet.jaxb.reflection.model.impl.RuntimeModelBuilder.getClassInfo(Unknown
> Source)
> at org.jvnet.jaxb.reflection.model.impl.RuntimeModelBuilder.getClassInfo(Unknown
> Source)
> at org.jvnet.jaxb.reflection.model.impl.ModelBuilder.getTypeInfo(Unknown
> Source)
> at org.jvnet.jaxb.reflection.model.impl.ModelBuilder.getTypeInfo(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)
> at docbook.tools.SchemaReflection.main(SchemaReflection.java:104)
>
>
> line 104 is: RuntimeTypeInfoSet model = JAXBModelFactory.create(
> Book.class);
>
> There is no a com.sun.istack.FinalArrayList class in my jre classpath but a
> com.sun.istack.internal.FinalArrayList class.
>
> I've tried with different versions of jaxb from
> https://jaxb2-reflection.dev.java.net/ (nightly and stable releases)
>
> There is a bug with the library? Im doing something wrong?
>
>
> Thanks in advance,
>
> Raul
>
>
>
> /*
> * SchemaReflection.java
> *
> * Created on 10 de mayo de 2007, 12:33
> *
> * To change this template, choose Tools | Template Manager
> * and open the template in the editor.
> */
>
> package docbook.tools;
>
>
> import docbook.schema.binder.Book;
> import java.lang.annotation.Annotation;
> import java.lang.reflect.Field;
> import javax.xml.bind.annotation.XmlAccessType;
> import javax.xml.bind.annotation.XmlAccessorType;
> import javax.xml.bind.annotation.XmlAttribute;
> import javax.xml.bind.annotation.XmlElement;
> import javax.xml.bind.annotation.XmlElements;
> import javax.xml.bind.annotation.XmlID;
> import javax.xml.bind.annotation.XmlIDREF;
> import javax.xml.bind.annotation.XmlRootElement;
> import javax.xml.bind.annotation.XmlType;
> import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
> import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
>
> import org.jvnet.jaxb.reflection.JAXBModelFactory;
> import org.jvnet.jaxb.reflection.model.runtime.RuntimeClassInfo;
> import org.jvnet.jaxb.reflection.model.runtime.RuntimePropertyInfo;
> import org.jvnet.jaxb.reflection.model.runtime.RuntimeTypeInfoSet;
> import org.jvnet.jaxb.reflection.runtime.IllegalAnnotationsException;
>
> /**
> *
> * @author raul
> */
> public class SchemaReflection {
>
>
> /**
> * @param args
> * the command line arguments
> */
> public static void main(String[] args) {
> //new SchemaReflection();
>
> try {
> RuntimeTypeInfoSet model = JAXBModelFactory.create(Book.class);
> RuntimeClassInfo ci = (RuntimeClassInfo) model
> .getTypeInfo(Book.class);
> System.out.println(ci.getElementName());
>
> for (RuntimePropertyInfo p : ci.getProperties()) {
>
> System.out.println(p.getName() + ' ' + p.kind());
> }
>
> } catch (IllegalAnnotationsException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
>


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com