File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes i am getting error in hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "i am getting error in hibernate" Watch "i am getting error in hibernate" New topic

i am getting error in hibernate

Ramamohan Gadilli

Joined: Aug 09, 2006
Posts: 1
i am new to hibernate,

i am getting error in hbm.xml file

SEVERE: Error parsing XML: XML InputStream(3) The processing instruction target matching "[xX][mM][lL]" is not allowed.
org.hibernate.MappingException: Could not read mappings from resource: CD.hbm.xml
at org.hibernate.cfg.Configuration.addClass(
at CDTest.<init>(
at CDTest.main(
Caused by: org.hibernate.MappingException: Could not parse mapping document in input stream
at org.hibernate.cfg.Configuration.addInputStream(
at org.hibernate.cfg.Configuration.addClass(
... 2 more
Caused by: org.dom4j.DocumentException: Error on line 3 of document : The processing instruction target matching "[xX][mM][lL]"
s not allowed. Nested exception: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at org.hibernate.cfg.Configuration.addInputStream(
... 3 more

any one please can you help me
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

CD.hbm.xml appears to be invalid XML. Check that. If you can't see what is making it invalid, you can post it here and someone may point out your mistake.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Suyash Soni

Joined: Jun 09, 2013
Posts: 6
CD.hbm.xml is as follows please tell me the mistake that i've done.

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"

<class name="hibernate6.CD" table="cd">
<id name="id" type="integer">
<generator class="hilo"/>

<discriminator column="cd-type" type="string"/>

<property name="title"/>
<property name="artist"/>
<property name="purchaseDate" type="date"/>
<property name="cost" type="double"/>

<subclass name="hibernate6.SpecialEditionCD">
<property name="newfeatures" type="string"/>

<subclass name="InternationalCD">
<property name="languages"/>
<property name="region" type="int"/>
I agree. Here's the link:
subject: i am getting error in hibernate
jQuery in Action, 3rd edition