0 Replies Latest reply: Jan 8, 2015 1:21 PM by 960009 RSS

    Component class not found exception

    960009

      SLF4J: Class path contains multiple SLF4J bindings.
      SLF4J: Found binding in [jar:file:/D:/Anubhav/MyR&D/Hib_EmpDeptRel/WebContent/WEB-INF/lib/slf4j-jdk14-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/D:/Anubhav/MyR&D/Hib_EmpDeptRel/WebContent/WEB-INF/lib/slf4j-log4j12-1.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/D:/Anubhav/MyR&D/Hib_EmpDeptRel/WebContent/WEB-INF/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/D:/Anubhav/MyR&D/Hib_EmpDeptRel/WebContent/WEB-INF/lib/slf4j-nop-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/D:/Anubhav/MyR&D/Hib_EmpDeptRel/WebContent/WEB-INF/lib/slf4j-simple-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
      Sep 5, 2012 11:44:15 AM org.hibernate.cfg.Environment <clinit>
      INFO: Hibernate 3.3.0.SP1
      Sep 5, 2012 11:44:15 AM org.hibernate.cfg.Environment <clinit>
      INFO: hibernate.properties not found
      Sep 5, 2012 11:44:15 AM org.hibernate.cfg.Environment buildBytecodeProvider
      INFO: Bytecode provider name : javassist
      Sep 5, 2012 11:44:15 AM org.hibernate.cfg.Environment <clinit>
      INFO: using JDK 1.4 java.sql.Timestamp handling
      Sep 5, 2012 11:44:15 AM org.hibernate.cfg.Configuration configure
      INFO: configuring from resource: /hibernate.cfg.xml
      Sep 5, 2012 11:44:15 AM org.hibernate.cfg.Configuration getConfigurationInputStream
      INFO: Configuration resource: /hibernate.cfg.xml
      Sep 5, 2012 11:44:15 AM org.hibernate.cfg.Configuration addResource
      INFO: Reading mappings from resource : com/crmit/persistance/AnuDept.hbm.xml
      Sep 5, 2012 11:44:16 AM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
      INFO: Mapping class: AnuDept -> ANU_DEPT
      Sep 5, 2012 11:44:16 AM org.hibernate.cfg.Configuration addResource
      INFO: Reading mappings from resource : com/crmit/persistance/AnuEmployee.hbm.xml
      Sep 5, 2012 11:44:16 AM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
      INFO: Mapping class: AnuEmployee -> ANU_EMPLOYEE
      Sep 5, 2012 11:44:16 AM org.hibernate.cfg.Configuration addResource
      INFO: Reading mappings from resource : com/crmit/persistance/AnuEmpdept.hbm.xml
      Sep 5, 2012 11:44:16 AM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
      INFO: Mapping class: AnuEmpdept -> ANU_EMPDEPT
      Sep 5, 2012 11:44:16 AM org.hibernate.cfg.Configuration doConfigure
      INFO: Configured SessionFactory: null
      Sep 5, 2012 11:44:16 AM org.hibernate.cfg.HbmBinder bindCollectionSecondPass
      INFO: Mapping collection: AnuDept.anuEmpdepts -> ANU_EMPDEPT
      Sep 5, 2012 11:44:16 AM org.hibernate.cfg.HbmBinder bindCollectionSecondPass
      INFO: Mapping collection: AnuEmployee.anuEmpdepts -> ANU_EMPDEPT
      Sep 5, 2012 11:44:16 AM org.hibernate.cfg.HbmBinder bindCollectionSecondPass
      INFO: Mapping collection: AnuEmployee.anuDepts -> ANU_DEPT
      org.hibernate.MappingException: component class not found: AnuEmpdeptId
      at org.hibernate.mapping.Component.getComponentClass(Component.java:127)
      at org.hibernate.tuple.component.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:156)
      at org.hibernate.tuple.component.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:66)
      at org.hibernate.tuple.component.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:61)
      at org.hibernate.tuple.component.ComponentEntityModeToTuplizerMapping.<init>(ComponentEntityModeToTuplizerMapping.java:76)
      at org.hibernate.tuple.component.ComponentMetamodel.<init>(ComponentMetamodel.java:73)
      at org.hibernate.mapping.Component.buildType(Component.java:175)
      at org.hibernate.mapping.Component.getType(Component.java:168)
      at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:276)
      at org.hibernate.mapping.RootClass.validate(RootClass.java:216)
      at org.hibernate.cfg.Configuration.validate(Configuration.java:1135)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1320)
      at com.crmit.businessOperationBO.InsertIntoTable.main(InsertIntoTable.java:25)
      Caused by: java.lang.ClassNotFoundException: AnuEmpdeptId
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      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.util.ReflectHelper.classForName(ReflectHelper.java:123)
      at org.hibernate.mapping.Component.getComponentClass(Component.java:124)
      ... 12 more

      This is the exception that i m getting. Given below is my cfg file

      <?xml version="1.0" encoding="utf-8"?>
      <!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.driver_class">oracle.jdbc.driver.OracleDriver</property>
      <property name="hibernate.connection.password">training</property>
      <property name="hibernate.connection.url">jdbc:oracle:thin:@192.168.1.30:1521:crminf</property>
      <property name="hibernate.connection.username">training</property>
      <property name="hibernate.default_schema">TRAINING</property>
      <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
      <mapping resource="com/crmit/persistance/AnuDept.hbm.xml"/>
      <mapping resource="com/crmit/persistance/AnuEmployee.hbm.xml"/>
      <mapping resource="com/crmit/persistance/AnuEmpdept.hbm.xml"/>
      </session-factory>
      </hibernate-configuration>

      and the hbm file is as
      <?xml version="1.0"?>
      <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
      <!-- Generated Sep 4, 2012 2:42:18 PM by Hibernate Tools 3.2.4.GA -->
      <hibernate-mapping>
      <class name="AnuEmpdept" table="ANU_EMPDEPT" schema="TRAINING">
      <composite-id name="id" class="AnuEmpdeptId">
      <key-property name="empId" type="string">
      <column name="EMP_ID" length="10" />
      </key-property>
      <key-property name="deptId" type="string">
      <column name="DEPT_ID" length="10" />
      </key-property>
      <key-property name="reportingtoId" type="string">
      <column name="REPORTINGTO_ID" length="20" />
      </key-property>
      </composite-id>
      <many-to-one name="anuDept" class="AnuDept" update="false" insert="false" fetch="select">
      <column name="DEPT_ID" length="10" />
      </many-to-one>
      <many-to-one name="anuEmployee" class="AnuEmployee" update="false" insert="false" fetch="select">
      <column name="EMP_ID" length="10" />
      </many-to-one>
      </class>
      </hibernate-mapping>

      plz tell me what can b done?