-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Error during the invoking setUp() method in Junit testcase
PostPosted: Mon Nov 08, 2004 5:45 am 
Beginner
Beginner

Joined: Tue Sep 21, 2004 1:03 pm
Posts: 21
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:


Top
 Profile  
 
 Post subject: Re: Error during the invoking setUp() method in Junit testca
PostPosted: Mon Nov 08, 2004 7:10 am 
Beginner
Beginner

Joined: Tue Sep 21, 2004 1:03 pm
Posts: 21
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:


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.