Hi,
I solved it by my by downloading the odmg-3.0.jar file and it's worked.
Thanks & Regards,
Irfan
IrfanAnsari wrote:
Hi,
Currently I'm facing a problem setting up the initial data in setUp() method of the class extending TestCase of Junit.
The code for the same is below.
public void setUp() throws Exception{
try{
Configuration hibernateConfig = new Configuration().configure("/price-range-trawler.cfg.xml");
persister = new HibernateCHMTrawlerPersister(hibernateConfig.buildSessionFactory());
}catch(Exception e){
log.error("Error during setup", e);
}
}
It seems that some jar file is missing. Could any one please let me know which jar file ?.
Thanks & Regards,
Irfan
Hibernate version:2.16
Mapping documents:<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.irfan.chm.trawler.instance.DefaultCHMProduct" table="drs_product">
<id name="id" column="id">
<generator class="com.irfan.chm.trawler.persistence.hibernate.V2HibernateIDGenerator">
<param name="table">drs_product</param>
<param name="maxCachedIDs">100</param>
</generator>
</id>
<property name="typeId" column="type_id" type="int"></property>
<property name="operatingEntity" column="operating_entity"></property>
<set name="drsCategories" table="drs_prod_parents" inverse="true">
<key>
<column name="product_id"></column>
</key>
<many-to-many class="com.irfan.chm.trawler.instance.DefaultCHMCategory">
<column name="category_id"/>
</many-to-many>
</set>
<joined-subclass name="com.irfan.chm.trawler.instance.DefaultCHMExternalHotel" table="external_hotel">
<key column="product_id"/>
<property name="propertyId" column="property_id"/>
</joined-subclass>
</class>
<class name="com.irfan.chm.trawler.instance.DefaultCHMCategory" table="drs_category">
<id name="id">
<generator class="com.irfan.chm.trawler.persistence.hibernate.V2HibernateIDGenerator">
<param name="table">drs_category</param>
<param name="maxCachedIDs">100</param>
</generator>
</id>
<set name="drsProducts" table="drs_prod_parents">
<key>
<column name="category_id"></column>
</key>
<many-to-many class="com.irfan.chm.trawler.instance.DefaultCHMProduct">
<column name="product_id"></column>
</many-to-many>
</set>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:java.lang.NoClassDefFoundError: org/odmg/DCollection
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at net.sf.hibernate.type.TypeFactory.set(TypeFactory.java:198)
at net.sf.hibernate.mapping.Set.getCollectionType(Set.java:29)
at net.sf.hibernate.mapping.Collection.getType(Collection.java:275)
at net.sf.hibernate.cfg.Binder.bindProperty(Binder.java:454)
at net.sf.hibernate.cfg.Binder.createProperty(Binder.java:1081)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1061)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:362)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1256)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:252)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:288)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:336)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:1013)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:969)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:897)
at com.lastminute.chm.trawler.persistence.hibernate.HibernateCHMTrawlerPersisterTest.setUp(HibernateCHMTrawlerPersisterTest.java:43)
at junit.framework.TestCase.runBare(TestCase.java:138)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:131)
at junit.framework.TestSuite.runTest(TestSuite.java:173)
at junit.framework.TestSuite.run(TestSuite.java:168)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
Name and version of the database you are using:Informix 9.4
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: