Hibernate annotations are wonderful, however when used with JAXB2 annotations, it looks like the schemagen task does not work too well. I know this is a JAXB2 problem, but thought of asking here and see if anyone has seen/fixed this problem. Any help would be appreciated!
Code:
[schemagen] error: Could not create declaration for annotation type ManyToMany
[schemagen] error: Could not create declaration for annotation type SequenceGenerator
[schemagen] error: Could not create declaration for annotation type GeneratedValue
[schemagen] error: Could not create declaration for annotation type Id
[schemagen] error: Could not create declaration for annotation type JoinTable
[schemagen] error: Could not create declaration for annotation type Table
[schemagen] error: Could not create declaration for annotation type Column
[schemagen] error: Could not create declaration for annotation type Entity
[schemagen] Problem encountered during annotation processing;
[schemagen] see stacktrace below for more information.
[schemagen] java.lang.ClassCastException: com.sun.tools.apt.mirror.type.ClassTypeImpl cannot be cast to com.sun.mirror.type.AnnotationType
[schemagen] at com.sun.tools.apt.mirror.declaration.AnnotationMirrorImpl.getAnnotationType(AnnotationMirrorImpl.java:82)
[schemagen] at com.sun.tools.jxc.apt.InlineAnnotationReaderImpl.getAllAnnotations(InlineAnnotationReaderImpl.java:113)
[schemagen] at com.sun.tools.jxc.apt.InlineAnnotationReaderImpl.getAllMethodAnnotations(InlineAnnotationReaderImpl.java:102)
[schemagen] at com.sun.tools.jxc.apt.InlineAnnotationReaderImpl.getAllMethodAnnotations(InlineAnnotationReaderImpl.java:64)
[schemagen] at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.findGetterSetterProperties(ClassInfoImpl.java:924)
[schemagen] at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:298)
[schemagen] at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:243)
[schemagen] at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:209)
[schemagen] at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:315)
[schemagen] at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:330)
[schemagen] at com.sun.tools.xjc.api.impl.j2s.JavaCompilerImpl.bind(JavaCompilerImpl.java:90)
[schemagen] at com.sun.tools.jxc.apt.SchemaGenerator$1.process(SchemaGenerator.java:115)
[schemagen] at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
[schemagen] at com.sun.tools.apt.comp.Apt.main(Apt.java:454)
[schemagen] at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:258)
[schemagen] at com.sun.tools.apt.main.Main.compile(Main.java:1102)
[schemagen] at com.sun.tools.apt.main.Main.compile(Main.java:964)
[schemagen] at com.sun.tools.apt.Main.processing(Main.java:95)
[schemagen] at com.sun.tools.apt.Main.process(Main.java:85)
[schemagen] at com.sun.tools.apt.Main.process(Main.java:67)
[schemagen] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[schemagen] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[schemagen] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[schemagen] at java.lang.reflect.Method.invoke(Method.java:597)
[schemagen] at com.sun.tools.jxc.AptBasedTask$InternalAptAdapter.execute(AptBasedTask.java:97)
[schemagen] at com.sun.tools.jxc.AptBasedTask.compile(AptBasedTask.java:144)
[schemagen] at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:820)
[schemagen] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[schemagen] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[schemagen] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[schemagen] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[schemagen] at java.lang.reflect.Method.invoke(Method.java:597)
[schemagen] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[schemagen] at org.apache.tools.ant.Task.perform(Task.java:348)
[schemagen] at org.apache.tools.ant.Target.execute(Target.java:357)
[schemagen] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[schemagen] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[schemagen] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[schemagen] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[schemagen] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[schemagen] at org.apache.tools.ant.Main.runBuild(Main.java:698)
[schemagen] at org.apache.tools.ant.Main.startAnt(Main.java:199)
[schemagen] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
[schemagen] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)