aspose file tools*
The moose likes Object Relational Mapping and the fly likes Nested exception: Content is not allowed in prolog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Nested exception: Content is not allowed in prolog" Watch "Nested exception: Content is not allowed in prolog" New topic
Author

Nested exception: Content is not allowed in prolog

Rohan Puvvada
Greenhorn

Joined: Jan 23, 2010
Posts: 2
Hi,

I am getting the followin error


Exception in thread "main" org.hibernate.HibernateException: problem parsing configuration/hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1291)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1230)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1216)
at NetworkElement.main(NetworkElement.java:32)
Caused by: org.dom4j.DocumentException: Error on line 5 of document : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
at org.dom4j.io.SAXReader.read(SAXReader.java:350)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1286)
... 3 more


when I am trying to compile the following code..

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">


- <hibernate-configuration>
- <session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property>
<property name="hibernate.connection.url">jdbcracle:thin:@97.247.10.178:1521ra</property>
<property name="hibernate.connection.username">user</property>
<property name="hibernate.connection.password">password</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>

<mapping resource="test.hbm.xml"/>
</session-factory>
</hibernate-configuration>



It would be of gret help to me if any of the gurus here can help me out..
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


- <hibernate-configuration>

What are those hyphens doing in front of your XML? Did you cut and paste from IE?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Rohan Puvvada
Greenhorn

Joined: Jan 23, 2010
Posts: 2
hey i am sorry abt the hyphens.. I copy pasted frm IE..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Nested exception: Content is not allowed in prolog