-->
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.  [ 2 posts ] 
Author Message
 Post subject: HIbernate application does not work without internet
PostPosted: Fri Aug 30, 2013 1:41 pm 
Newbie

Joined: Fri Aug 30, 2013 1:35 pm
Posts: 1
Hi
I am new to hibernate. My application works fine with internetconnection but it gives me the following error without a net connection. The error thrown is

Failed to create sessionFactory object. org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
at ManageEmployee.main(ManageEmployee.java:16)
Caused by: org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1542)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1476)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at ManageEmployee.main(ManageEmployee.java:13)
Caused by: org.dom4j.DocumentException: www.hibernate.sourceforge.net Nested exception: www.hibernate.sourceforge.net
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1532)
... 3 more




My hibernate.cfg.xml file is as given below


<?xml version='1.0'?>

<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>

<!-- Assume test is the database name -->
<property name="hibernate.connection.url">
jdbc:mysql://localhost/test
</property>
<property name="hibernate.connection.username">
root
</property>
<property name="hibernate.connection.password">
*****
</property>

<!-- List of XML mapping files -->
<mapping resource="Employee.hbm.xml"/>

</session-factory>
</hibernate-configuration>


Any suggestions welcome.

Thanks In Advance


Top
 Profile  
 
 Post subject: Re: HIbernate application does not work without internet
PostPosted: Fri Aug 30, 2013 11:17 pm 
Newbie

Joined: Sun Jun 20, 2010 9:57 pm
Posts: 7
Location: Madison WI
It sounds like your application is trying to access the hibernate DTD that is referenced by the hibernate.cfg.xml file:

http://www.hibernate.sourceforge.net/hibernate-configuration-3.0.dtd

Have you tried seeing if you can reference a local DTD instead? I found this forum post that looks like would resolve your issue: https://forum.hibernate.org/viewtopic.php?t=943281

Sarah


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.