[Help] Hibernate-Annotation and Eclipse RCP [message #466615] |
Mon, 23 April 2007 01:37 |
Eclipse User |
|
|
|
Originally posted by: vedantaulises.gmail.com
Well, this time I want to try hibernate-annotation after I tried with 'only' hibernate-core in my test application.
I have set all hibernate-core dependencies into eclipse plugins and intergrate it with my-test-rcp. and It worked. I could get my SessionFactory worked as expected. I am using HibernateUtils as in hibernate reference and integrating hibernate and its dependecies as in http://www.hibernate.org/311.html (I also added the same comment there). I used Hibernate 3.2.3
Then I try to use hibernate-annotations, sounds great. Using the same plugins dependecies and additional ejb3_persistence plugin, hibernate_annotations plugin into the OSGI buddy loading. I removed/ rename the *.hbm.xml file to make sure it would not be called. and of course add the annotation mark to the entity. as in hibernate_annotation reference. I used hibernate_annotation 3.2.1
I were sure there was no compatibility problem. CMIIW
First, I got JUnit test case running, and it was smooth as expected. SessionFactory worked and also CRUD test entity also worked.
Second. I run my-test-rcp and an exception thrown:
<code>
java.lang.IllegalAccessError: tried to access method org.hibernate.cfg.Mappings.<init> (Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map ;Ljava/util/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/Lis t;Ljava/util/List;Lorg/hibernate/cfg/NamingStrategy;Ljava/ut il/Map;Ljava/util/Map;Ljava/util/Map;Ljava/util/List;Ljava/u til/Map;Ljava/util/Map;)V from class org.hibernate.cfg.ExtendedMappings
at org.hibernate.cfg.ExtendedMappings.<init>(ExtendedMappings.java:65)
at org.hibernate.cfg.AnnotationConfiguration.createExtendedMapp ings(AnnotationConfiguration.java:166)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile( AnnotationConfiguration.java:254)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1286)
at net.vata.my.test.rcp.core.model.hibernate.HibernateUtils.<clinit >(HibernateUtils.java:23)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at net.vata.my.test.rcp.ui.Application.run(Application.java:25)
.....
</code>
I have checked and debuged the code and I found the system failed when accessing the super class of ExtendedMappings. I checked every parameters type to make sure there was no missed class casting. and I don't understand why this happened. :(
Did I missed something? Any comments or solution are welcome. :)
|
|
|
Powered by
FUDForum. Page generated in 0.03307 seconds