Just wanted to add that I am having the same problem. All I'm trying to do is a load. Can I tag on this one, or should I start a new thread?
I'm using hibernate2.1, jboss-3.2.3, and xdoclet-1.2
I can see where jboss/hibernate finds my mapping file on deploy and it looks O.K. to me, but I still get the MappingException.
Here is info from jboss logs when I deploy the hibernate sar, it looks like it is deploying Orginization correctly
2004-02-20 21:23:56,883 INFO [org.jboss.ejb.EjbModule] Deploying HibernateService
2004-02-20 21:23:56,957 INFO [net.sf.hibernate.jmx.HibernateServiceMBean] starting service at JNDI name: java:/repository/hibernate
2004-02-20 21:23:56,958 INFO [net.sf.hibernate.jmx.HibernateServiceMBean] service properties: {hibernate.session_factory_name=java:/repository/hibernate, hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, hibernate.show_sql=true, hibernate.use_outer_join=false, hibernate.connection.datasource=java:/MVDS-hotel}
2004-02-20 21:23:57,038 INFO [net.sf.hibernate.cfg.Environment] Hibernate 2.1.2
2004-02-20 21:23:57,043 INFO [net.sf.hibernate.cfg.Environment] hibernate.properties not found
2004-02-20 21:23:57,053 INFO [net.sf.hibernate.cfg.Environment] using CGLIB reflection optimizer
2004-02-20 21:23:57,083 INFO [net.sf.hibernate.cfg.Configuration] Mapping resource: com/rubicon/mv/Orginization.hbm.xml
2004-02-20 21:23:57,349 DEBUG [net.sf.hibernate.util.DTDEntityResolver] trying to locate
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath under net/sf/hibernate/
2004-02-20 21:23:57,352 DEBUG [net.sf.hibernate.util.DTDEntityResolver] found
http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd in classpath
2004-02-20 21:23:57,968 INFO [net.sf.hibernate.cfg.Binder] Mapping class: com.rubicon.mv.Orginization -> org
2004-02-20 21:23:58,275 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: orginizationId -> org_id, type: long
2004-02-20 21:23:58,332 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: features -> features, type: string
2004-02-20 21:23:58,333 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: monthlyShops -> monthly_shops, type: integer
2004-02-20 21:23:58,333 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: remainingShops -> remain_shops, type: integer
2004-02-20 21:23:58,334 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: brandedWebSitesCar -> bws_data_sources, type: string
2004-02-20 21:23:58,334 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: authorizedDataSourcesCar -> auth_data_sources, type: string
2004-02-20 21:23:58,335 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: authorizedDataSourcesHotel -> hotel_auth_data_sources, type: string
2004-02-20 21:23:58,335 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: brandedWebSitesHotel -> hotel_web_data_sources, type: string
2004-02-20 21:23:58,336 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: dataSourceCosts -> data_source_costs, type: string
2004-02-20 21:23:58,336 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: subscribeType -> subscribe_type, type: string
2004-02-20 21:23:58,379 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: subscribeGDS -> subscribe_gds, type: string
2004-02-20 21:23:58,379 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: subscribeWEB -> subscribe_web, type: string
2004-02-20 21:23:58,380 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: subscribeFV -> subscribe_fv, type: string
2004-02-20 21:23:58,381 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: subscribeQ -> subscribe_q, type: string
2004-02-20 21:23:58,381 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: orgAuthCode -> org_auth_cd, type: string
2004-02-20 21:23:58,382 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: ownerUserId -> owner_usr_id, type: long
2004-02-20 21:23:58,382 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: orgName -> org_name, type: string
2004-02-20 21:23:58,383 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: orgLongName -> org_long_name, type: string
2004-02-20 21:23:58,383 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: authOrgEmail -> auth_org_email, type: string
2004-02-20 21:23:58,384 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: primaryOrgEmail -> pri_org_email, type: string
2004-02-20 21:23:58,384 DEBUG [net.sf.hibernate.cfg.Binder] Mapped property: createDate -> create_dttm, type: timestamp
2004-02-20 21:23:58,385 INFO [net.sf.hibernate.cfg.Configuration] processing one-to-many association mappings
2004-02-20 21:23:58,385 INFO [net.sf.hibernate.cfg.Configuration] processing one-to-one association property references
2004-02-20 21:23:58,386 INFO [net.sf.hibernate.cfg.Configuration] processing foreign key constraints
2004-02-20 21:23:58,474 INFO [net.sf.hibernate.dialect.Dialect] Using dialect: net.sf.hibernate.dialect.MySQLDialect
2004-02-20 21:23:58,478 INFO [net.sf.hibernate.cfg.SettingsFactory] Use outer join fetching: false
2004-02-20 21:23:58,507 INFO [net.sf.hibernate.util.NamingHelper] JNDI InitialContext properties:{}
2004-02-20 21:23:58,524 INFO [net.sf.hibernate.connection.DatasourceConnectionProvider] Using datasource: java:/MVDS-hotel
2004-02-20 21:23:58,547 INFO [net.sf.hibernate.transaction.TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
2004-02-20 21:23:58,558 INFO [net.sf.hibernate.cfg.SettingsFactory] Use scrollable result sets: true
2004-02-20 21:23:58,558 INFO [net.sf.hibernate.cfg.SettingsFactory] Use JDBC3 getGeneratedKeys(): true
2004-02-20 21:23:58,559 INFO [net.sf.hibernate.cfg.SettingsFactory] Optimize cache for minimal puts: false
2004-02-20 21:23:58,559 INFO [net.sf.hibernate.cfg.SettingsFactory] echoing all SQL to stdout
2004-02-20 21:23:58,560 INFO [net.sf.hibernate.cfg.SettingsFactory] Query language substitutions: {}
2004-02-20 21:23:58,560 INFO [net.sf.hibernate.cfg.SettingsFactory] cache provider: net.sf.ehcache.hibernate.Provider
2004-02-20 21:23:58,572 INFO [net.sf.hibernate.cfg.Configuration] instantiating and configuring caches
2004-02-20 21:23:59,018 INFO [net.sf.hibernate.impl.SessionFactoryImpl] building session fac
.
.
.
Hereis the exception:
2004-02-20 21:25:25,767 DEBUG [com.rubicon.mvh.TestAction] EXECUTING TestAction
2004-02-20 21:25:25,767 DEBUG [com.rubicon.mvh.TestAction] Inside retreieveOrg
2004-02-20 21:25:25,786 DEBUG [com.rubicon.repository.hibernate.HibernateServiceEJB] loading object by identity
2004-02-20 21:25:25,788 DEBUG [net.sf.hibernate.impl.SessionFactoryObjectFactory] JNDI lookup: repository/hibernate
2004-02-20 21:25:25,788 DEBUG [net.sf.hibernate.impl.SessionFactoryObjectFactory] lookup: uid=2c918384fad5e2dc00fad5e2e2360000
2004-02-20 21:25:25,978 DEBUG [net.sf.hibernate.impl.SessionImpl] opened session
2004-02-20 21:25:25,984 DEBUG [net.sf.hibernate.impl.SessionImpl] loading [com.rubicon.mv.Orginization#1]
2004-02-20 21:25:25,999 ERROR [com.rubicon.repository.hibernate.HibernateServiceEJB] load failed net.sf.hibernate.MappingException: No persister for: com.rubicon.mv.Orginization
2004-02-20 21:25:26,246 DEBUG [com.opensymphony.webwork.dispatcher.ServletDispatcherResult] Forwarding to location /form.jsp
2004-02-20 21:25:26,772 DEBUG [net.sf.hibernate.impl.SessionImpl] running Session.finalize()
2004-02-20 21:25:33,718 DEBUG [com.opensymphony.webwork.lifecycle.RequestLifecycleFilter] Request DefaultComponentManager : dispose
Here is the code it is trying to run (shamelessly stolen from the example)
TestAction.java
private void retrieveOrg() throws Exception{
_log.debug( "Inside retreieveOrg");
try {
// obtain sesison bean
IHibernateService hs = HibernateServiceUtil.getHome().create();
org = ( Orginization ) hs.load( Orginization.class, new Long(1) );
}
catch( Exception ex )
{
_log.error( "exception: ", ex );
}
}
HibernateRepsoitoryEJB.java
public Object load( Class c, Serializable id )
{
Object ret = null;
_log.debug( "loading object by identity" );
try
{
Session sess = getSession();
ret = sess.load( c, id, LockMode.NONE );
sess.close();
}
catch( Exception ex )
{
_log.error( "load failed " + ex );
_ctx.setRollbackOnly();
}
return ret;
}
Hmmm..... everything else is create by xdcolet
jboss-service.xml
<server>
<mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateRepository">
<depends>jboss.jca:service=RARDeployer</depends>
<attribute name="MapResources">com/rubicon/mv/Orginization.hbm.xml</attribute>
<attribute name="JndiName">java:/repository/hibernate</attribute>
<attribute name="Datasource">java:/MVDS-hotel</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.MySQLDialect</attribute>
<attribute name="UseOuterJoin">false</attribute>
<attribute name="ShowSql">true</attribute>
</mbean>
</server>
<hibernate-mapping>
<class
name="com.rubicon.mv.Orginization"
table="org"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="orginizationId"
column="org_id"
type="java.lang.Long"
unsaved-value="null"
>
<generator class="native">
</generator>
</id>
<property
name="features"
type="java.lang.String"
update="true"
insert="true"
column="features"
/>
<property
name="monthlyShops"
type="java.lang.Integer"
update="true"
insert="true"
column="monthly_shops"
/>
<property
name="remainingShops"
type="java.lang.Integer"
update="true"
insert="true"
column="remain_shops"
/>
<property
name="brandedWebSitesCar"
type="java.lang.String"
update="true"
insert="true"
column="bws_data_sources"
/>
<property
name="authorizedDataSourcesCar"
type="java.lang.String"
update="true"
insert="true"
column="auth_data_sources"
/>
<property
name="authorizedDataSourcesHotel"
type="java.lang.String"
update="true"
insert="true"
column="hotel_auth_data_sources"
/>
<property
name="brandedWebSitesHotel"
type="java.lang.String"
update="true"
insert="true"
column="hotel_web_data_sources"
/>
<property
name="dataSourceCosts"
type="java.lang.String"
update="true"
insert="true"
column="data_source_costs"
/>
<property
name="subscribeType"
type="java.lang.String"
update="true"
insert="true"
column="subscribe_type"
/>
<property
name="subscribeGDS"
type="java.lang.String"
update="true"
insert="true"
column="subscribe_gds"
/>
<property
name="subscribeWEB"
type="java.lang.String"
update="true"
insert="true"
column="subscribe_web"
/>
<property
name="subscribeFV"
type="java.lang.String"
update="true"
insert="true"
column="subscribe_fv"
/>
<property
name="subscribeQ"
type="java.lang.String"
update="true"
insert="true"
column="subscribe_q"
/>
<property
name="orgAuthCode"
type="java.lang.String"
update="true"
insert="true"
column="org_auth_cd"
/>
<property
name="ownerUserId"
type="java.lang.Long"
update="true"
insert="true"
column="owner_usr_id"
/>
<property
name="orgName"
type="java.lang.String"
update="true"
insert="true"
column="org_name"
/>
<property
name="orgLongName"
type="java.lang.String"
update="true"
insert="true"
column="org_long_name"
/>
<property
name="authOrgEmail"
type="java.lang.String"
update="true"
insert="true"
column="auth_org_email"
/>
<property
name="primaryOrgEmail"
type="java.lang.String"
update="true"
insert="true"
column="pri_org_email"
/>
<property
name="createDate"
type="java.util.Date"
update="true"
insert="true"
column="create_dttm"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Orginization.xml
containing the additional properties and place it in your merge dir.
-->
</class>
Thanks,
Alex