-->
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.  [ 4 posts ] 
Author Message
 Post subject: HibernateTools: Could not load AnnotationConfiguration
PostPosted: Wed Sep 19, 2007 9:11 am 
Newbie

Joined: Wed Sep 19, 2007 9:03 am
Posts: 2
hibernate-3.2.5.ga, hibernate-annotations-3.3.0.GA, HibernateTools-3.2.0.beta10, Oracle 9.2.0.8


I've :
- created hibernate.cfg.xml
- created hibernate console usign hibernate.cfg.xml (with "Annotations" option)
- used console to create code generator
- used generator to create java class from jdbc connection (Domain generator) and to insert its definitions in hibernate.cfg.xml (with enabled options "Use Java 5 syntax" and "Generate EJB3 annotations")

Next, when I'm trying to open console (Create Session Factory or double-click) I'm getting an exception :
org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="pl.com.pentacomp.kpp.daj.SourceInterfaceVersions"/>

This exception raises if references to any generated class appears in hibernate.cfg.xml.

It seems Hibernate Tools doesn't see hibernate-annotations.jar (or hibernate-commons-annotations.jar) - but generator does !
I was trying to include directy this library into classpath in console definition but with no success.

I'm very astonish because I've repeated all described above operations in new separate Eclipse project (only to test Hibernate Tools) and I have no problems with console (everything was OK).
It means Hibenate Tools behaviour is not deterministic?

Any idea how to solve this problem (I need to have working console in main project) ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 26, 2007 4:15 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Did you enable "Annotations" on the console configuration ?

If you just use "core", AnnotationConfiguration is not used.


If code generation works its probably because you are using reverse engineering which does not load any annotated classes, it just reads its mappings by reading the jdbc schema.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 28, 2007 4:20 am 
Newbie

Joined: Wed Sep 19, 2007 9:03 am
Posts: 2
Of course I've got enabled this option.

In the meantime I've repeated (several times) all steps described above (from clean project without Hibernate Tools plugin installed, on different machines) and results wasn't the same :-). Ones it works OK, some other time error occurs without any reason.

I've generated Hibernate objects but I've wasted many time because of unpredictable behaviour of Hibernate Tools .

It is not critique, Hibernate idea is very good but "defects happends" :-)

--------------------
Live long and prosper...

holger74


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 28, 2007 8:08 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
If you find a pattern at some time; e.g. if its the first time you start it that it fails or when you have specific classes/libs in your classpath then let me know so I can try and reproduce (and fix).


btw. showing me the full stacktrace would also be beneficial ;)

_________________
Max
Don't forget to rate


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