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.  [ 1 post ] 
Author Message
 Post subject: "ClassNotFoundException" for "composite-id" Mapping Element
PostPosted: Tue Sep 22, 2009 2:20 pm 
Newbie

Joined: Sat Nov 22, 2008 1:35 pm
Posts: 7
I am getting a "ClassNotFoundException" for a "composite-id" element in a hibernate mapping file during deployment of a hibernate app even though the class in question does correctly exist in the GGGoMobile.jar file.

I am using NetBeans 6.7.1 Hibernate utilities to reverse engineer a MySQL 5 database and generate the mapping files, JBOSS 5.1.0, and Hibernate 3.3.1.

Application Structure:
Code:
GGGoMobile.ear
     +META-INF
          + gggomobile-hibernate.xml   
          + application.xml   
          + jboss-app.xml
     +GGGoMobileLib.jar  (contains all hibernate mapping files and compiled .class files)

... other JAR and WAR files


Hibernate Mapping File:
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">
<!-- Generated Sep 21, 2009 5:32:06 PM by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping>
    <class name="com.clarksonville.gm.lib.data.GmStoreAdKeyword" table="gm_store_ad_keyword" catalog="gggomobiledb">
        <composite-id name="id" class="com.clarksonville.gm.lib.data.GmStoreAdKeywordId">
            <key-property name="adKeywordId" type="int">
                <column name="ad_keyword_id" />
            </key-property>
            <key-property name="storeAdId" type="int">
                <column name="store_ad_id" />
            </key-property>
        </composite-id>
        <many-to-one name="gmStoreAd" class="com.clarksonville.gm.lib.data.GmStoreAd" update="false" insert="false" fetch="select">
            <column name="store_ad_id" not-null="true" />
        </many-to-one>
        <many-to-one name="gmAdKeyword" class="com.clarksonville.gm.lib.data.GmAdKeyword" update="false" insert="false" fetch="select">
            <column name="ad_keyword_id" not-null="true" />
        </many-to-one>
        <property name="keywordBid" type="java.lang.Float">
            <column name="keyword_bid" precision="12" scale="0" />
        </property>
    </class>
</hibernate-mapping>


gggomobile-hibernate.xml
Code:
<hibernate-configuration xmlns="urn:jboss:hibernate-deployer:1.0">
   <session-factory name="java:/hibernate/GGGoMobileSessionFactory" bean="jboss.gggomobile:name=GGGoMobileSessionFactory">
      <property name="datasourceName">java:/GGGoMobileDS</property>
      <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
      <depends>jboss:service=Naming</depends>
      <depends>jboss:service=TransactionManager</depends>
   </session-factory>
</hibernate-configuration>


Error Stack Trace:
Code:
11:41:39,435 ERROR [AbstractKernelController] Error installing to Start: name=jboss.gggomobile:name=GGGoMobileSessionFactory state=Create
org.hibernate.MappingException: component class not found: com.clarksonville.gm.lib.data.GmStoreAdKeywordId
        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)

...

Caused by: java.lang.ClassNotFoundException: com.clarksonville.gm.lib.data.GmStoreAdKeywordId from BaseClassLoader@6dcfde{VFSClassLoaderPolicy@16a3075{name=vfsfile:/C:/JBoss/jboss-5.1.0.GA/server/default/conf/jboss-service.xml domain=ClassLoaderDomain@16877f8{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@867e89 ...

        at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:123)
        at org.hibernate.mapping.Component.getComponentClass(Component.java:124)
        ... 72 more


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.