Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.2.2
Mapping documents:
Code:
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.sssistemas.opera.bean">
<class name="Atividade" table="Atividade">
<!-- Coluna identificadora -->
<id name="id" column="id" type="integer">
<generator class="assigned" />
</id>
<property name="descricao" column="descricao" type="string" length="60" />
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Does not apply here. The error is before openSession().
Full stack trace of any exception that occurs:Code:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.ExceptionInInitializerError
at HibernateUtil.<clinit>(HibernateUtil.java:12)
at Teste.<init>(Teste.java:4)
at Teste.main(Teste.java:34)
Caused by: org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="Atividade"/>
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1600)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1555)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1534)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1508)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1428)
at HibernateUtil.<clinit>(HibernateUtil.java:9)
... 2 more
Name and version of the database you are using:
PostgreSQL 8.2.6
The generated SQL (show_sql=true):
Does not apply. Cannot execute SQL since error is in configure() method.
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html