-->
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: Sessionfactory kann nicht erstellt werden (MappingException)
PostPosted: Tue Feb 27, 2007 6:24 am 
Newbie

Joined: Fri Jan 05, 2007 9:15 am
Posts: 5
Hallo zusammen. Ich habe ein Problem mit org.hibernate.MappingException: component class not found: .

Ich hab per Hibernate Reverse Engineering mir einige Tabellen einer DB zugänglich gemacht. Das Projekt kompiliert auch alles wunderbar, und ich hatte schon fast das Gefühl, dass alles funktionieren könnte. Bis zum ersten Test...

Ich versuche die SessionFactory zu erzeugen. Der übergebene Pfad für das Configfile stimmt. Im Configfile musste ich nachträglich (das hatte das Reverseegnineering nicht gemacht) die Mappingfiles mit absoluten Pfadangaben eintragen.
Die Mappingfiles beziehen sich ja immer auf eine konkrete Klasse. Diese Klassen findet jetzt Hibernate nicht. Die Klassen liegen im selben ordner wie die die mapping files.

hmmm...da kommt mir eine Idee ...

ich vermute es fehlt wieder die Pfadangabe... ich experimentiere mal weiter. Fall jemand hier den Kardinalsweg kennt: Bitte melden.


Hibernate version:
3

Mapping documents:
Von Hib.Rev.Eng. erzeugt.

Code between sessionFactory.openSession() and session.close():
Soweit komm ich gar nicht.

Full stack trace of any exception that occurs:
Exception in thread "main" org.hibernate.MappingException: component class not found: TFtypId
at org.hibernate.mapping.Component.getComponentClass(Component.java:101)
at org.hibernate.tuple.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:105)
at org.hibernate.tuple.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:40)
at org.hibernate.tuple.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:112)
at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:68)
at org.hibernate.mapping.Component.getType(Component.java:156)
at org.hibernate.cfg.Configuration$1.getIdentifierType(Configuration.java:1499)
at org.hibernate.type.EntityType.getIdentifierType(EntityType.java:227)
at org.hibernate.type.EntityType.getIdentifierOrUniqueKeyType(EntityType.java:237)
at org.hibernate.type.ManyToOneType.getColumnSpan(ManyToOneType.java:35)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:252)
at org.hibernate.mapping.ToOne.isValid(ToOne.java:81)
at org.hibernate.mapping.Property.isValid(Property.java:174)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:325)
at org.hibernate.mapping.RootClass.validate(RootClass.java:188)
at org.hibernate.cfg.Configuration.validate(Configuration.java:839)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1000)
at de.[...].test.JU_LeasingObjektImplTest.main(JU_LeasingObjektImplTest.java:88)
Caused by: java.lang.ClassNotFoundException: TFtypId
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
at org.hibernate.mapping.Component.getComponentClass(Component.java:98)
... 21 more

Name and version of the database you are using:
Oracle 9


Last edited by Flash on Wed Feb 28, 2007 6:44 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 27, 2007 6:34 am 
Newbie

Joined: Fri Jan 05, 2007 9:15 am
Posts: 5
Ok... Ich hab im mappingfile jetzt den Pfad eingestellt:
Code:
<hibernate-mapping package="de.richtiger.paket.name">
   <class name="Ttyp" table="T_TYP">
      <composite-id name="id" class="TtypId">
         <key-property name="fcode" type="short">
            <column name="FCODE" precision="3" scale="0" />
         </key-property>
         <key-property name="mcode" type="int">
            <column name="MCODE" precision="5" scale="0" />
         </key-property>
      </composite-id>
      <many-to-one name="Thrst" class="Thrst" update="false"
         insert="false" fetch="select">
         <column name="FCODE" precision="3" scale="0"
            not-null="true" />
      </many-to-one>
      <property name="mtext" type="string">
         <column name="MTEXT" length="50" />
      </property>
      
      [...] (Hier stehen noch mehr properties)
      
      <set name="Tmods" inverse="true">
         <key>
            <column name="FCODE" precision="3" scale="0" />
            <column name="MCODE" precision="5" scale="0" />
         </key>
         <one-to-many class="Tmod" />
      </set>
   </class>
</hibernate-mapping>


Jetzt erhalte ich aber diesen Fehler:
Code:
Exception in thread "main" org.hibernate.MappingException: Association references unmapped class: TFtyp
   at org.hibernate.cfg.HbmBinder.bindCollectionSecondPass(HbmBinder.java:2036)
   at org.hibernate.cfg.HbmBinder$CollectionSecondPass.secondPass(HbmBinder.java:2497)
   at org.hibernate.cfg.HbmBinder$SecondPass.doSecondPass(HbmBinder.java:2468)
   at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:884)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:999)
   at de.itsas.leasit.service.leasingobjekt.translator.lhs.LHS2LeasitTranslator.<init>(LHS2LeasitTranslator.java:36)
   at de.itsas.leasit.service.leasingobjekt.translator.TranslatorFactory.getTranslator(TranslatorFactory.java:24)
   at de.itsas.leasit.service.leasingobjekt.impl.LeasingObjektImpl.getProduktgruppen(LeasingObjektImpl.java:270)
   at de.itsas.leasit.service.leasingobjekt.test.JU_LeasingObjektImplTest.test_getProduktgruppen(JU_LeasingObjektImplTest.java:47)
   at de.itsas.leasit.service.leasingobjekt.test.JU_LeasingObjektImplTest.main(JU_LeasingObjektImplTest.java:88)


ich fühl mich wie ein Blinder. Ich hab keine Ahnung was ich machen muss. :(


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.