-->
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.  [ 3 posts ] 
Author Message
 Post subject: Many-To-Many relationship problem
PostPosted: Mon Nov 10, 2003 5:35 pm 
Newbie

Joined: Wed Nov 05, 2003 7:56 pm
Posts: 2
I have an error killing me while trying to set up the Many-To-Many relationships. I tried to simulate the Author-Work example from Hiberante examples but ended up with the following error. Can anybody please let me know what's going on. The error is thrown when trying to initialize the .hbm files at the set tag. Somebody please !

Brief Mappings ----
Code:
<class name="tests.Item" schema="test" table="Item" dynamic-update="false">
....
....
<set name="items" table="LINE_ITEMS" inverse="false" lazy="false" cascade="all" sort="unsorted">
<key column="item_id" />
<many-to-many class="tests.Lookup" outer-join="auto" column="lookup_id" />
</set>

</class>


<class name="tests.Lookup" schema="test" table="Lookup" dynamic-update="false">
....
....
<set name="lookups" table="LINE_ITEMS" lazy="false" inverse="false" cascade="all" sort="unsorted">
   <key column="lookup_id" />
    <many-to-many class="tests.Item" column="item_id" outer-join="auto"/>
</set>

</class>


Classes and Items dbase script -----------
Code:
class Item{
   private java.util.Set lookups;   
   
}

class Lookup{
   private java.util.Set items;   
   
}

CREATE TABLE LINE_ITEMS (
       Item_Id              INTEGER NOT NULL,
       Lookup_Id        INTEGER NOT NULL
);


The big huge error that is thrown. Please look for the sentence is CAPS. Guess that is where the error is.

Code:
java.lang.NoClassDefFoundError: org/odmg/DCollection
   at java.lang.ClassLoader.defineClass0(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
   at java.lang.ClassLoader.defineClass0(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
   at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
   at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
   at net.sf.hibernate.type.TypeFactory.set(TypeFactory.java:184)
   
   AT NET.SF.HIBERNATE.MAPPING.SET.GETTYPE(SET.JAVA:29)
   
   at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:875)
   at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:294)
   at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1095)
   at net.sf.hibernate.cfg.Configuration.add(Configuration.java:230)
   at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:252)
   at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:286)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:324)
   at junit.framework.TestCase.runTest(TestCase.java:166)
   at junit.framework.TestCase.runBare(TestCase.java:140)
   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:392)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 6:08 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Look to me you dont have the odmg.jar in the class path.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 6:28 pm 
Newbie

Joined: Wed Nov 05, 2003 7:56 pm
Posts: 2
You're right. Thanks for responding so quickly.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.