title: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.component.PojoComponentTuplizer]
body: <p>My Hibernate version is 4.3<br>
  My Class Career has a composite primary key CareerId, and when use hibernate tool reveng.xml to generate, class Career and class CareerId is generated, but only Career.hbm.xml is generated, CareerId.hbm.xml is not gnereated. </p>
  
  <p>And in database, only Career table is existed, no CareerId table is existed.</p>
  
  <p>From the stacktrace, </p>
  
  <blockquote>
    <p>Caused by: org.hibernate.MappingException: component class not found: CareerId</p>
  </blockquote>
  
  <p>is this mean the error is due to no CarrerId.hbm.xml is generated?</p>
  
  <p>My Hibernate.config.xml is as follow:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
  &lt;session-factory&gt;
      &lt;property name="hibernate.connection.driver_class"&gt;com.microsoft.sqlserver.jdbc.SQLServerDriver&lt;/property&gt;
      &lt;property name="hibernate.connection.password"&gt;!QAZ2wsx&lt;/property&gt;
      &lt;property name="hibernate.connection.url"&gt;jdbc:sqlserver://localhost:65064;databaseName=Testing&lt;/property&gt;
      &lt;property name="hibernate.connection.username"&gt;sa&lt;/property&gt;
      &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.SQLServerDialect&lt;/property&gt;
      &lt;property name="hibernate.search.autoregister_listeners"&gt;true&lt;/property&gt;
      &lt;property name="hibernate.validator.apply_to_ddl"&gt;false&lt;/property&gt;
      &lt;property name="hibernate.current_session_context_class"&gt;thread&lt;/property&gt;
      &lt;mapping resource="Staff.hbm.xml" /&gt;
      &lt;mapping resource="Career.hbm.xml" /&gt;
  &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>my Career.hbm.xml is as follow:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"&gt;
  &lt;!-- Generated 2019?~7??14?? ?W??02:43:26 by Hibernate Tools 4.3.5.Final --&gt;
  &lt;hibernate-mapping&gt;
  &lt;class name="Career" table="Career" schema="dbo" catalog="Testing" optimistic-lock="version"&gt;
      &lt;composite-id name="id" class="CareerId"&gt;
          &lt;key-property name="staffNo" type="serializable"&gt;
              &lt;column name="Staff_No" /&gt;
          &lt;/key-property&gt;
          &lt;key-property name="dateToRank" type="timestamp"&gt;
              &lt;column name="Date_To_Rank" length="23" /&gt;
          &lt;/key-property&gt;
          &lt;key-property name="rankAbbr" type="serializable"&gt;
              &lt;column name="Rank_Abbr" /&gt;
          &lt;/key-property&gt;
      &lt;/composite-id&gt;
      &lt;property name="title" type="serializable"&gt;
          &lt;column name="title" /&gt;
      &lt;/property&gt;
      &lt;property name="createdBy" type="serializable"&gt;
          &lt;column name="Created_By" /&gt;
      &lt;/property&gt;
      &lt;property name="createdDate" type="timestamp"&gt;
          &lt;column name="Created_Date" length="23" /&gt;
      &lt;/property&gt;
  &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>My staff.hbm.xml is as follow:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"&gt;
  &lt;!-- Generated 2019?~7??14?? ?W??02:43:26 by Hibernate Tools 4.3.5.Final --&gt;
  &lt;hibernate-mapping&gt;
  &lt;class name="Staff" table="Staff" schema="dbo" catalog="Testing" optimistic-lock="version"&gt;
      &lt;id name="staffNo" type="serializable"&gt;
          &lt;column name="StaffNo" /&gt;
          &lt;generator class="assigned" /&gt;
      &lt;/id&gt;
      &lt;property name="name" type="serializable"&gt;
          &lt;column name="Name" /&gt;
      &lt;/property&gt;
      &lt;property name="createdDate" type="timestamp"&gt;
          &lt;column name="CreatedDate" length="23" /&gt;
      &lt;/property&gt;
      &lt;property name="createdBy" type="serializable"&gt;
          &lt;column name="CreatedBy" /&gt;
      &lt;/property&gt;
  &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>The whole error message is</p>
  
  <pre><code>    Exception in thread "main" java.lang.ExceptionInInitializerError
  at output.Test1.main(Test1.java:17)
  Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.component.PojoComponentTuplizer]
  at org.hibernate.tuple.component.ComponentTuplizerFactory.constructTuplizer(ComponentTuplizerFactory.java:101)
  at org.hibernate.tuple.component.ComponentTuplizerFactory.constructDefaultTuplizer(ComponentTuplizerFactory.java:122)
  at org.hibernate.tuple.component.ComponentMetamodel.&lt;init&gt;(ComponentMetamodel.java:81)
  at org.hibernate.mapping.Component.getType(Component.java:180)
  at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:322)
  at org.hibernate.mapping.RootClass.validate(RootClass.java:271)
  at org.hibernate.cfg.Configuration.validate(Configuration.java:1360)
  at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1851)
  at output.HibernateUtil.buildSessionFactory(HibernateUtil.java:38)
  at output.HibernateUtil.&lt;clinit&gt;(HibernateUtil.java:19)
  ... 1 more
  Caused by: java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  at java.lang.reflect.Constructor.newInstance(Unknown Source)
  at org.hibernate.tuple.component.ComponentTuplizerFactory.constructTuplizer(ComponentTuplizerFactory.java:98)
  ... 10 more
  Caused by: org.hibernate.MappingException: component class not found: CareerId
  at org.hibernate.mapping.Component.getComponentClass(Component.java:141)
  at org.hibernate.tuple.component.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:155)
  at org.hibernate.tuple.component.AbstractComponentTuplizer.&lt;init&gt;(AbstractComponentTuplizer.java:64)
  at org.hibernate.tuple.component.PojoComponentTuplizer.&lt;init&gt;(PojoComponentTuplizer.java:59)
  ... 15 more
  Caused by: java.lang.ClassNotFoundException: CareerId
  at java.net.URLClassLoader.findClass(Unknown Source)
  at java.lang.ClassLoader.loadClass(Unknown Source)
  at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
  at java.lang.ClassLoader.loadClass(Unknown Source)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Unknown Source)
  at org.hibernate.internal.util.ReflectHelper.classForName(ReflectHelper.java:193)
  at org.hibernate.mapping.Component.getComponentClass(Component.java:138)
  ... 18 more
  </code></pre>