[hibernate-issues] [Hibernate-JIRA] Created: (HBX-989) org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="any generated class">

Dariusz jutrowski (JIRA) noreply at atlassian.com
Tue Sep 18 08:38:14 EDT 2007


org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="any generated class">
----------------------------------------------------------------------------------------------------------------------------

                 Key: HBX-989
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-989
             Project: Hibernate Tools
          Issue Type: Bug
          Components: consoleconfiguration
    Affects Versions: 3.2beta10
         Environment: hibernate-3.2.5.ga, hibernate-annotations-3.3.0.GA, HibernateTools-3.2.0.beta10, Oracle 9.2.0.8
            Reporter: Dariusz jutrowski


I've :
- created hibernate.cfg.xml
- created hibernate console usign hibernate.cfg.xml
- 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) ?





-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list