• Post Reply Bookmark Topic Watch Topic
  • New Topic

MappingException  RSS feed

Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following snippet of code from hibernate-config.xml file and

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"


<!-- a SessionFactory instance listed as /jndi/name -->
<property name="hibernate.show_sql">false</property>
<!-- properties -->
<property name="hibernate.connection.datasource">jdbc/cplg</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>

<mapping resource="Account.hbm.xml"/>

<mapping resource="SymomCplgLookup.hbm.xml"/>
<mapping resource="UserRole.hbm.xml"/>
<mapping resource="UserGovtEduRef.hbm.xml"/>



And in my UserGovtEduRef.hbm.xml this is the code
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"

<hibernate-mapping default-cascade="all" default-lazy="false">

<class name="com.symantec.qg.bo.UserGovtEduRefBO" table="QG_BUYING_PROGRAM_MAP">
<id name="bpmId" type="long" >
<generator class="native"/>
<property name="isGovtCountry" column="GOV_COUNTRY"/>
<property name="isEduCountry" column="EDU_COUNTRY"/>

<query name="lookupGovtPrograms">
select distinct gov_country from UserGovtEduRefBO where edu_country ='Y' and country_id= ?

<query name="lookupEduPrograms">
select distinct edu_country from UserGovtEduRefBO where gov_country = 'Y' and country_id = ?


The Object class UserGovtEduRefBO is created in the jar file and is always found

But when I start my application server It throws me following stacktrace
[7/25/06 13:11:26:133 PDT] 0000003b Configuration E TRAS0014I: The following exception was logged org.hibernate.MappingException: class com.symantec.qg.bo.GovtEduProgBO not found while looking for property: isGovtCountry

After this also follwing stacktrace crie for same missing UserGovtEduRefBO.class

Since I am new to Hibernate I am not sure what missing pieces I need to assemble ot make it work

If any one has come across same scenario and has solution then please help me also

Thanks in advance

Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The app server's classloaders can't find the class anywhere in it's classpath.

Is class name spelled correctly in the mapping file? Assuming the class is deployed in a jar, is the jar in the application's or the app server's classpath? Are the permissions correct on the jar?
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!