Hi Friends,
I got this exception plz help me.
====================Exception===================
=============================================
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 first.Hiberutil.<clinit>(Hiberutil.java:20)
at first.Main.addEmployee(Main.java:20)
at first.Main.main(Main.java:9)
Caused by: org.hibernate.MappingException: Association references unmapped class: EmployeeTask
at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2344)
at org.hibernate.cfg.HbmBinder$CollectionSecondPass.secondPass(HbmBinder.java:2618)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1012)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1168)
at first.Hiberutil.<clinit>(Hiberutil.java:15)
... 2 more
==================Employee.hbm.xml================
==============================================
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="first.Employee" table="Employee">
<id name="id" type="int">
<generator class="increment"/>
</id>
<set name="SET" inverse="true" cascade="save-update,delete">
<key column="empID"/>
<one-to-many class="EmployeeTask" />
</set>
<property name="name" type="string"/>
<property name="age" type="int"/>
<property name="empid" type="string"/>
</class>
</hibernate-mapping>
===============EmployeeTask.hbm.xml================
==============================================
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="first.EmployeeTask" table="EmployeeTask">
<id name="id" type="int">
<generator class="increment"/>
</id>
<property name="project" type="string"/>
<property name="device" type="string"/>
<property name="deadline" type="string"/>
<property name="status" type="string"/>
<many-to-one name="empID" property-ref = "empid" class="first.Employee" not-null="true" cascade="save-update,delete"/>
</class>
</hibernate-mapping>
Thanks in adv....
|