-->
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.  [ 6 posts ] 
Author Message
 Post subject: Exception when using Annotated Classes and HBM files
PostPosted: Tue Aug 22, 2006 7:13 pm 
Newbie

Joined: Thu Dec 11, 2003 10:06 pm
Posts: 8
I'm using Hibernate 3.2 CR2 and Hibernate Annotations 3.2 CR1. My hibernate.cfg.xml looks like:
Code:
<hibernate-configuration>
   <session-factory>
      <mapping class="com.mypackage.MyClass"/>
      <mapping resource="com/mypackage/OtherClassHbm.xml"/>
   </session-factory>
</hibernate-configuration>


And I get the following exception:

Code:
java.lang.IllegalAccessError: tried to access field org.hibernate.cfg.Configuration.xmlHelper from class org.hibernate.cfg.AnnotationConfiguration
   at org.hibernate.cfg.AnnotationConfiguration.addInputStream(AnnotationConfiguration.java:556)
   at org.hibernate.cfg.Configuration.addResource(Configuration.java:482)
   at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:425)
   at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)
   at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)
   at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)
   at org.hibernate.cfg.Configuration.configure(Configuration.java:1325)


When I drop the mapped resource, i.e. just use a mapped class, there is no problem. This seems like a case of the Hibernate Annotations and Hibernate core code being out of syn. I know that I can't use Hibernate 3.2 CR3 with Hibernate Annotations because I'll get a java.lang.NoClassDefFoundError: org/hibernate/loader/custom/SQLQueryReturn ( see http://forums.java.net/jive/thread.jspa?messageID=133554&tstart=0 )
I tried Hibernate 3.2 CR1 just for kicks, and it was a no-go as well. Any ideas? Do I need to build both Hibernate3 and HibernateExt from source, or is mixing annotated classes and mapping files just not supported.

Note: The two classes in the sample hibernate.cfg.xml do not reference each other.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 23, 2006 1:30 am 
Regular
Regular

Joined: Mon Mar 06, 2006 6:18 am
Posts: 95
Location: Bern, Switzerland
hello

i had the same problem a few days ago. In my case i had a library problem . So make sure you are using the right libraries. I use Hibernate 3.2CR2 and hibernate annotations 3.2CR1 and it works.

Mixing of annotatedClasses and mapping files is supported :-)

regards angela


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 06, 2006 9:47 am 
Newbie

Joined: Wed Sep 28, 2005 4:07 am
Posts: 11
It is a shame that you cannot download Hibernate 3.2CR2 anymore.

_________________
Lars Fiedler


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 06, 2006 3:40 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
What are you talking about?!
http://sourceforge.net/project/showfiles.php?group_id=40712&package_id=127784

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 16, 2006 3:39 pm 
Beginner
Beginner

Joined: Wed Dec 17, 2003 10:13 am
Posts: 33
emmanuel wrote:


org.hibernate.loader.custom.SQLQueryReturn does not appear in CR4. Why not?

%

_________________
MOD


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 16, 2006 5:11 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
http://forum.hibernate.org/viewtopic.php?t=964828&start=0&postdays=0&postorder=asc&highlight=

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.