Hallo zusammen. ich bekomme folgende Fehlermeldung beim Laden der Config-datei:
Code:
Initialisierung der DB-Verbindung fehlgeschlagen. org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:110)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:135)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:80)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:323)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:475)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:133)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:295)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
at calculator.ComponentManager.initialise(ComponentManager.java:42)
Der Java-Code:
Code:
this.sessionFactoryLocal = new Configuration().configure("/calculator/container.cfg.xml").buildSessionFactory();
Container.cfg.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : hibernate.cfg.xml
Created on : 2006年5月13日, 上午12:11
Author : daiwei
Description:
Purpose of the document follows.
-->
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.username">lomcalc</property>
<property name="hibernate.connection.password">lomcalc</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/localhibernate</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hiberante.show_sql">true</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">update</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!--
-->
<mapping resource="calculator/CalcComponent.hbm.xml" ></mapping>
<mapping resource="calculator/LOMRankingNames.hbm.xml" ></mapping>
</session-factory>
</hibernate-configuration>
CalcComponent.hbm.xml:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="calculator.CalcComponent" table="calcComponents">
<id name="id" column="COMPONENT_ID">
<generator class="native"/>
</id>
<discriminator column="COMPONENT_TYPE" type="string"/>
<property name="typ" column="TYP"/>
<subclass name="calculator.AddComponent" discriminator-value="Addition">
<property name="name" column='COMPONENT_NAME'></property>
<property name="finaleFormel" column='FINALE_FORMEL'></property>
<property name="iconAddress" column='ICON_ADDRESS'></property>
<many-to-one name="leftComponent" column='LEFT_COMPONENT_ID' class="calculator.CalcComponent">
</many-to-one>
<many-to-one name="rightComponent" column='RIGHT_COMPONENT_ID' class="calculator.CalcComponent"></many-to-one>
<property name="finalComponent" column='FINAL_COMPONENT'></property>
</subclass>
<subclass name="calculator.SubComponent" discriminator-value="Subtraktion">
<property name="name" column='COMPONENT_NAME'></property>
<property name="finaleFormel" column='FINALE_FORMEL'></property>
<property name="iconAddress" column='ICON_ADDRESS'></property>
<many-to-one name="leftComponent" column='LEFT_COMPONENT_ID' class="calculator.CalcComponent"></many-to-one>
<many-to-one name="rightComponent" column='RIGHT_COMPONENT_ID' class="calculator.CalcComponent"></many-to-one>
<property name="finalComponent" column='FINAL_COMPONENT'></property>
</subclass>
<subclass name="calculator.DivComponent" discriminator-value="Division">
<property name="name" column='COMPONENT_NAME'></property>
<property name="finaleFormel" column='FINALE_FORMEL'></property>
<property name="iconAddress" column='ICON_ADDRESS'></property>
<many-to-one name="leftComponent" column='LEFT_COMPONENT_ID' class="calculator.CalcComponent"></many-to-one>
<many-to-one name="rightComponent" column='RIGHT_COMPONENT_ID' class="calculator.CalcComponent"></many-to-one>
<property name="finalComponent" column='FINAL_COMPONENT'></property>
</subclass>
<subclass name="calculator.MulComponent" discriminator-value="Multiplikation">
<property name="name" column='COMPONENT_NAME'></property>
<property name="finaleFormel" column='FINALE_FORMEL'></property>
<property name="iconAddress" column='ICON_ADDRESS'></property>
<many-to-one name="leftComponent" column='LEFT_COMPONENT_ID' class="calculator.CalcComponent"></many-to-one>
<many-to-one name="rightComponent" column='RIGHT_COMPONENT_ID' class="calculator.CalcComponent"></many-to-one>
<property name="finalComponent" column='FINAL_COMPONENT'></property>
</subclass>
<subclass name="calculator.DataComponent" discriminator-value ="Daten">
<property name="scoringMethod" column='SCORING_METHOD'></property>
<property name="lomObjectType" column='LOM_OBJECT_TYPE'></property>
</subclass>
<subclass name="calculator.NumberComponent" discriminator-value="Zahl">
<property name="number" column='NUMBER_VALUE'></property>
</subclass>
</class>
</hibernate-mapping>
und LOMRankingNames.hbm.xml:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="calculator.LOMRankingNames" table="LOMRANKINGNAMES">
<id name="id" column="RANKINGID">
<generator class="native"/>
</id>
<property name="name" column='RANKING_NAME'></property>
</class>
</hibernate-mapping>
Das wirklich verwunderliche: Einzeln klappt das laden ohne probleme. Wenn ich also in der container.cfg die zeile zu LOMRankingNames oder CalcComponent lösche, dann startet alles ohne Probleme. Aber beide zusammen funktioniert nicht.
Was mache ich falsch?