-->
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.  [ 4 posts ] 
Author Message
 Post subject: weird MappingException
PostPosted: Thu Nov 17, 2005 2:11 am 
Beginner
Beginner

Joined: Thu Oct 06, 2005 8:14 pm
Posts: 23
I have a very weird scenario.
I have a struts front end and this talks to my ejbs and then hibernate.For one particualar jsp I get this
org.hibernate.MappingException and it says that it cannot read the mappings from the hbm.xml but for all other jsps it is able to read the mappings from this cfg.xml and reads this particular hbm.xml.Any idea what the error could be
I am posting the error snippet.


2005-11-17 15:54:26,582 INFO [STDOUT] error----org.hibernate.MappingException: Could not read mappings from resource: au/com/xbnet/document/connotes/services/connotehiber/ConNote.hbm.xml
2005-11-17 15:54:26,582 DEBUG [org.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath under org/hibernate/
2005-11-17 15:54:26,582 INFO [STDOUT] ***** Error Creating SessionFactory *****
2005-11-17 15:54:26,582 DEBUG [org.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath
2005-11-17 15:54:26,598 INFO [STDOUT] org.hibernate.MappingException: Could not read mappings from resource: au/com/xbnet/document/connotes/services/connotehiber/ConNote.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:472)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1396)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1364)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1345)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1321)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1241)
at au.com.xbnet.utils.HibernateUtils.currentSession(HibernateUtils.java:49)
at au.com.xbnet.document.connotes.services.connotehiber.ConNoteHelper.<init>(ConNoteHelper.java:49)
at au.com.xbnet.document.connotes.services.connotemanager.ConNoteManager.senderDetails(ConNoteManager.java:156)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)
at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:54)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
at org.jboss.ejb.Container.invoke(Container.java:873)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)


Thanks
priya


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 2:19 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
Can you post the contents of ConNote.hbm.xml , the mapping element line in hibernate.cfg.xml for this file, as well as the path of ConNote.hbm.xml in the same application that the stacktrace occurs?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 2:30 am 
Beginner
Beginner

Joined: Thu Oct 06, 2005 8:14 pm
Posts: 23
Thanks for the reply.Do let me knwo if I am dng somethign horrendously wrong.This is my first experience with hibernate:)and I have had really v little time to learn:)


<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>

<!--CONNOTE-->


<class
name="au.com.xbnet.document.connotes.datatypes.ConNote"
table="testing_connote" lazy="true">
<id
name="conNoteRef"
type="string"
column="connote_ref" >
<generator class="assigned"/>
</id>

<many-to-one name="serviceType" class="au.com.xbnet.document.connotes.datatypes.ServiceVO" column="service_id"
unique="true" cascade="all" />

<many-to-one name="statusId" class="au.com.xbnet.document.connotes.datatypes.StatusTypesVO" column="status_id"
unique="true" cascade="all" />

<many-to-one name="packingId" class="au.com.xbnet.document.connotes.datatypes.PackingVO" column="packing_id"
unique="true" cascade="all" />

<many-to-one name="paymentMethod" class="au.com.xbnet.document.connotes.datatypes.PaymentVO" column="payment_method_id"
unique="true" cascade="all" />
<many-to-one name="userId" class="au.com.xbnet.admin.datatypes.UserVO" column="user_id"
unique="true" cascade="all" />

<many-to-one name="originId" class="au.com.xbnet.admin.datatypes.PortVO" column="origin_id"
unique="true" cascade="all" />

<many-to-one name="destinationId" class="au.com.xbnet.admin.datatypes.PortVO" column="destination_id"
unique="true" cascade="all" />



<set name="items" table="testconnote_item" lazy="false">
<key column="connote_ref" />
<one-to-many class="au.com.xbnet.document.connotes.datatypes.ConItemVO" />
</set>

<set name="manifestItems" table="test_manifest_item" lazy="false">
<key column="connote_ref" />
<one-to-many class="au.com.xbnet.document.manifest.datatypes.ManifestItemVO" />
</set>

<set name="charges" table="fms_connote_charges" lazy="false">
<key column="connote_ref" />
<one-to-many class="au.com.xbnet.rates.datatypes.ConNoteCharges" />
</set>

<property
name="conNoteCreation"
column="connote_date"
type="java.sql.Timestamp"
not-null="false"
/>
<property
name="conNoteDispatch"
column="dispatch_date"
type="java.sql.Timestamp"
not-null="false"
/>
<property
name="chargeTo"
column="charge_to"
type="integer"
not-null="false"
/>
<property
name="isHandRated"
column="is_handrated"
type="boolean"
not-null="false"
/>
<property
name="isDangerous"
column="is_dangerous"
type="boolean"
not-null="false"
/>
<property
name="additionalInstructions"
column="instructions"
type="string"
not-null="false"
/>

<property
name="notes"
column="notes"
type="string"
not-null="false"
/>
</class>



</hibernate-mapping>

Hibernate.cfg.xml mapping

<mapping resource="au/com/xbnet/document/connotes/services/connotehiber/ConNote.hbm.xml"/>

Stack trace of jboss where it maps for all other jsps

2005-11-17 16:19:56,120 DEBUG [org.hibernate.cfg.Configuration] null<-org.dom4j.tree.DefaultAttribute@f3e133 [Attribute: name resource value "au/com/xbnet/document/connotes/services/connotehiber/ConNote.hbm.xml"]
2005-11-17 16:19:56,120 INFO [org.hibernate.cfg.Configuration] Reading mappings from resource: au/com/xbnet/document/connotes/services/connotehiber/ConNote.hbm.xml
2005-11-17 16:19:56,120 DEBUG [org.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath under org/hibernate/
2005-11-17 16:19:56,120 DEBUG [org.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath
2005-11-17 16:19:56,261 INFO [org.hibernate.cfg.HbmBinder] Mapping class: au.com.xbnet.document.connotes.datatypes.ConNote -> testing_connote
2005-11-17 16:19:56,276 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: conNoteRef -> connote_ref
2005-11-17 16:19:56,448 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: serviceType -> service_id
2005-11-17 16:19:56,448 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: statusId -> status_id
2005-11-17 16:19:56,448 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: packingId -> packing_id
2005-11-17 16:19:56,448 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: paymentMethod -> payment_method_id
2005-11-17 16:19:56,448 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: userId -> user_id
2005-11-17 16:19:56,448 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: originId -> origin_id
2005-11-17 16:19:56,448 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: destinationId -> destination_id
2005-11-17 16:19:56,464 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: items
2005-11-17 16:19:56,464 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: manifestItems
2005-11-17 16:19:56,464 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: charges
2005-11-17 16:19:56,464 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: conNoteCreation -> connote_date
2005-11-17 16:19:56,464 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: conNoteDispatch -> dispatch_date
2005-11-17 16:19:56,464 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: chargeTo -> charge_to
2005-11-17 16:19:56,464 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: isHandRated -> is_handrated
2005-11-17 16:19:56,464 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: isDangerous -> is_dangerous
2005-11-17 16:19:56,464 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: additionalInstructions -> instructions
2005-11-17 16:19:56,464 DEBUG [org.hibernate.cfg.HbmBinder] Mapped property: notes -> notes


Stack trace for this particular jsp


2005-11-17 16:24:09,051 INFO [org.hibernate.cfg.Configuration] Configuration resource: WEB-INF/hibernate.xml
2005-11-17 16:24:09,051 DEBUG [org.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath under org/hibernate/
2005-11-17 16:24:09,051 DEBUG [org.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath under org/hibernate/
2005-11-17 16:24:09,051 DEBUG [org.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath
2005-11-17 16:24:09,051 DEBUG [org.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibern ... on-3.0.dtd in classpath
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] connection.driver_class=org.postgresql.Driver
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] connection.url=jdbc:postgresql://linux:5432/fmsdb
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] connection.username=postgres
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] connection.password=
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] connection.pool_size=1
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] connection.driver_class=org.postgresql.Driver
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] dialect=org.hibernate.dialect.PostgreSQLDialect
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] connection.url=jdbc:postgresql://linux:5432/fmsdb
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] show_sql=true
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] connection.username=postgres
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] hibernate.jdbc.batch_size=30
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] connection.password=
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] connection.pool_size=1
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] dialect=org.hibernate.dialect.PostgreSQLDialect
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] show_sql=true
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] null<-org.dom4j.tree.DefaultAttribute@16068c9 [Attribute: name resource value "au/com/xbnet/document/connotes/services/connotehiber/ConNote.hbm.xml"]
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] hibernate.jdbc.batch_size=30
2005-11-17 16:24:09,051 INFO [org.hibernate.cfg.Configuration] Reading mappings from resource: au/com/xbnet/document/connotes/services/connotehiber/ConNote.hbm.xml
2005-11-17 16:24:09,051 DEBUG [org.hibernate.cfg.Configuration] null<-org.dom4j.tree.DefaultAttribute@7f7957 [Attribute: name resource value "au/com/xbnet/document/connotes/services/connotehiber/ConNote.hbm.xml"]
2005-11-17 16:24:09,051 INFO [org.hibernate.cfg.Configuration] Reading mappings from resource: au/com/xbnet/document/connotes/services/connotehiber/ConNote.hbm.xml
2005-11-17 16:24:09,051 INFO [STDOUT] error----org.hibernate.MappingException: Could not read mappings from resource: au/com/xbnet/document/connotes/services/connotehiber/ConNote.hbm.xml
2005-11-17 16:24:09,051 DEBUG [org.hibernate.util.DTDEntityResolver] trying to locate http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath under org/hibernate/
2005-11-17 16:24:09,051 INFO [STDOUT] ***** Error Creating SessionFactory *****
2005-11-17 16:24:09,051 DEBUG [org.hibernate.util.DTDEntityResolver] found http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd in classpath
2005-11-17 16:24:09,067 INFO [STDOUT] org.hibernate.MappingException: Could not read mappings from resource: au/com/xbnet/document/connotes/services/connotehiber/ConNote.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:472)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1396)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1364)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1345)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1321)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1241)
at au.com.xbnet.utils.HibernateUtils.currentSession(HibernateUtils.java:49)
at au.com.xbnet.document.connotes.services.connotehiber.ConNoteHelper.<init>(ConNoteHelper.java:49)
at au.com.xbnet.document.connotes.services.connotemanager.ConNoteManager

Thanks
priya


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 2:47 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
are these JSPs in different apps? if they are in the same app, why aren't they using the same configuration? Try commenting out sections of the ConNote file to pin point the problem.


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

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.