-->
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: MappingException not parse mapping document input stream
PostPosted: Tue Jan 19, 2010 10:57 am 
Newbie

Joined: Mon Apr 16, 2007 2:30 am
Posts: 8
Location: Lahore
Hi,

i am getting exception

org.hibernate.MappingException: Could not parse mapping document in input stream
Caused by: org.dom4j.DocumentException: org.apache.xerces.impl.dv.xs.ListDV$ListData Nested exception: org.apache.xerces.impl.dv.xs.ListDV$ListData

actually i am using the sessionFactory ( AnnotationSessionFactoryBean ) and setting the mappingResources like


<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">

<property name="dataSource"> <ref bean="dataSource" /></property>

<property name="mappingResources">

<list>
<value>namedQueries.hbm.xml</value>
</list>
</property>

<property name="annotatedClasses">
<list>
<value>com.entity.impl.XXXEntity</value>
<value>com.entity.impl.XXXEntity</value>
</list>
</property>
</bean>

i want to utilize the NamedQueries, i don't want put @NamedQuery in entity class so that DBA can view the SQL query,

i ve trid following 2 file formats but still i am facing same exception

<?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>

<query name="getClientById"><![CDATA[
select c.id, c.firstName from com.mobex.mca.entity.impl.ClientEntity c where c.id = ?
]]></query>

</hibernate-mapping>



<?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>

<class name="com.mobex.mca.entity.impl.BankEntity" table="BANK">
<id name="id" type="long" column="ID" unsaved-value="0">
<generator class="increment"/>
</id>
<property name="bankName" column="BANK_NAME"/>
</class>

<query name="getClientById"><![CDATA[
select c.id, c.firstName from com.mobex.mca.entity.impl.ClientEntity c where c.id = ?
]]></query>

</hibernate-mapping>


Kindly reply

thanks

_________________
Kashif Bashir

Mobex Limited
kashefbasher@gmail.com


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.