The stack trace shows that the exception is coming form JAXB annotation
processor. It might be due to Collection being interface and JAXB
expecting a bean there. The error message could be better than
ClassCastException. You can report an issue at
http://jax-ws.dev.java.net.
-vivek.
Kenneth Clark wrote:
> I have a class with a Collection<Object> in it. And when I try to
> generate the jaxws artifacts I get the following error:
>
> Problem encountered during annotation processing;
> see stacktrace below for more information.
> java.lang.ClassCastException:
> com.sun.tools.apt.mirror.declaration.InterfaceDeclarationImpl
> at
> com.sun.tools.jxc.model.nav.APTNavigator.isOverriding(APTNavigator.java:260)
>
> at
> com.sun.tools.jxc.model.nav.APTNavigator.isOverriding(APTNavigator.java:49)
>
> at
> com.sun.xml.bind.v2.model.impl.ClassInfoImpl.findGetterSetterProperties(ClassInfoImpl.java:879)
>
> at
> com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:263)
>
> at
> com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:127)
>
> at
> com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189)
>
> at
> com.sun.xml.bind.v2.model.impl.TypeRefImpl.calcRef(TypeRefImpl.java:56)
> at
> com.sun.xml.bind.v2.model.impl.TypeRefImpl.getTarget(TypeRefImpl.java:33)
> at
> com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:38)
>
> at
> com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:41)
>
> at java.util.AbstractList$Itr.next(AbstractList.java:422)
> at
> com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:139)
>
> at
> com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189)
>
> at
> com.sun.xml.bind.v2.model.impl.TypeRefImpl.calcRef(TypeRefImpl.java:56)
> at
> com.sun.xml.bind.v2.model.impl.TypeRefImpl.getTarget(TypeRefImpl.java:33)
> at
> com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:38)
>
> at
> com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:41)
>
> at java.util.AbstractList$Itr.next(AbstractList.java:422)
> at
> com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:139)
>
> at
> com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189)
>
> at
> com.sun.xml.bind.v2.model.impl.TypeRefImpl.calcRef(TypeRefImpl.java:56)
> at
> com.sun.xml.bind.v2.model.impl.TypeRefImpl.getTarget(TypeRefImpl.java:33)
> at
> com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:38)
>
> at
> com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:41)
>
> at java.util.AbstractList$Itr.next(AbstractList.java:422)
> at
> com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:139)
>
> at
> com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189)
>
> at
> com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:204)
>
> at
> com.sun.tools.xjc.api.impl.j2s.JavaCompilerImpl.bind(JavaCompilerImpl.java:54)
>
> at
> com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.completeModel(WebServiceAP.java:395)
>
> at
> com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.process(WebServiceAP.java:236)
>
> at
> com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
>
> at com.sun.tools.apt.comp.Apt.main(Apt.java:454)
> at
> com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:448)
> at com.sun.tools.apt.main.Main.compile(Main.java:1075)
> at com.sun.tools.apt.main.Main.compile(Main.java:938)
> at com.sun.tools.apt.Main.processing(Main.java:95)
> at com.sun.tools.apt.Main.process(Main.java:85)
> at com.sun.tools.apt.Main.process(Main.java:67)
> at
> com.sun.tools.ws.wscompile.CompileTool.buildModel(CompileTool.java:603)
> at
> com.sun.tools.ws.wscompile.CompileTool.run(CompileTool.java:536)
> at com.sun.tools.ws.util.ToolBase.run(ToolBase.java:54)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:585)
> at com.sun.tools.ws.Invoker.main(Invoker.java:41)
> at com.sun.tools.ws.WsGen.main(WsGen.java:28)
>
> Does anyone have any ideas?
>
> Thanks
> Kenneth
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>