anyone give me solution that is details of my hibernate configuration
error is:
Exception in thread "main" java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at com.patelplastic.masterDao.HibernateFactory.configureSessionFactory(HibernateFactory.java:84)
at com.patelplastic.masterDao.HibernateFactory.buildIfNeeded(HibernateFactory.java:31)
at com.patelplastic.masterDao.AbstractDao.<init>(AbstractDao.java:14)
at com.patelplastic.masterDao.GroupInfoDao.<init>(GroupInfoDao.java:14)
at com.patelplastic.masterDao.GroupInformation.main(GroupInformation.java:11)
Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)`enter code here`
at java.lang.ClassLoader.loadClass(Unknown Source)
... 5 more
Hibrnate.cfg.xml :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://ift.tt/UNuKEc">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/billingsystemdevdb</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<mapping resource="GroupInfo.hbm.xml"/>
</session-factory>
</hibernate-configuration>
*.hbm.xml :
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://ift.tt/UNuKEd">
<!-- Generated Aug 27, 2014 10:54:21 AM by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
<class name="com.patelplastic.masterpojo.CategoryInformation" table="category_information" catalog="billingsystemdevdb">
<id name="id" type="java.lang.Long">
<column name="id" />
<generator class="identity" />
</id>
<property name="categoryCode" type="string">
<column name="category_code" not-null="true" />
</property>
<property name="categoryDes" type="string">
<column name="category_des" not-null="true" />
</property>
<set name="salesTransactions" table="sales_transaction" inverse="true" lazy="true" fetch="select">
<key>
<column name="category_info_id" not-null="true" />
</key>
<one-to-many class="com.patelplastic.masterpojo.SalesTransaction" />
</set>
</class>
</hibernate-mapping>
hibernate.reveng.xml :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://ift.tt/1dH7QaR" >
<hibernate-reverse-engineering>
<table-filter match-catalog="billingsystemdevdb" match-name="account_info"/>
<table-filter match-catalog="billingsystemdevdb" match-name="category_information"/>
<table-filter match-catalog="billingsystemdevdb" match-name="company_info_master"/>
<table-filter match-catalog="billingsystemdevdb" match-name="expense_info"/>
<table-filter match-catalog="billingsystemdevdb" match-name="group_info"/>
<table-filter match-catalog="billingsystemdevdb" match-name="item_group_information"/>
<table-filter match-catalog="billingsystemdevdb" match-name="item_master_maintenance"/>
<table-filter match-catalog="billingsystemdevdb" match-name="payment"/>
<table-filter match-catalog="billingsystemdevdb" match-name="sales_tax_information"/>
<table-filter match-catalog="billingsystemdevdb" match-name="sales_transaction"/>
<table-filter match-catalog="billingsystemdevdb" match-name="sub_sales_transaction"/>
</hibernate-reverse-engineering>
File Directory is :
project/src/hibernate.cfg.xml
project/src/package/*.hbm.xml
project/hibernate.reveng.xml
configuration code is :
private static SessionFactory configureSessionFactory() throws HibernateException {
Configuration configuration = new Configuration();
configuration.configure("hibernate.cfg.xml");
sessionFactory = configuration.buildSessionFactory();
return sessionFactory;
}
so give me solution i dont want error other time.
No comments:
Post a Comment