aspose file tools*
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
Author

i am getting error in hibernate

Ramamohan Gadilli
Greenhorn

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

i am getting error in hbm.xml file

like
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(Configuration.java:506)
at CDTest.<init>(CDTest.java:31)
at CDTest.main(CDTest.java:204)
Caused by: org.hibernate.MappingException: Could not parse mapping document in input stream
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:431)
at org.hibernate.cfg.Configuration.addClass(Configuration.java:503)
... 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.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:422)
... 3 more
java.lang.NullPointerException

any one please can you help me
Paul Sturrock
Bartender

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
Greenhorn

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"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

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

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

<subclass name="InternationalCD">
<property name="languages"/>
<property name="region" type="int"/>
</subclass>
</class>
</hibernate-mapping>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: i am getting error in hibernate