-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: JAXB2 annotations with Hibernate/JPA annotations
PostPosted: Wed Jun 11, 2008 10:34 am 
Newbie

Joined: Fri Dec 07, 2007 2:24 pm
Posts: 7
Location: Columbia, MD
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)

_________________
Alberto
http://www.linkedin.com/in/aflores


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 12, 2008 4:39 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

I haven't seen this error before, but I would place my bet on on a classpath problem.

Also have a look at http://archive.enunciate.codehaus.org/user/47B35E3C.8060201@verdantsys.com. I believe they refer to this bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6432333.

Are you sure that you have all needed jar files in the classpath when you run schemagen (including hibernate annotations)?

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.