-->
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: MappingException when try to run my first Hibernate app
PostPosted: Wed Aug 04, 2004 1:40 pm 
Newbie

Joined: Wed Aug 04, 2004 1:29 pm
Posts: 2
I am getting a MappingException (caused by a jdom DocumentException) when trying to do a proof-of-concept of Hibernate. I thought the problem could be due to the DTD, so I removed that from the XML and got the same problem.


Hibernate version 2.1

Mapping document:
<?xml version="1.0"?>

<hibernate-mapping>
<class name="hibtest.User" table="users">

<id name="ID" column="LogonId" type="string">
<generator class="assigned"/>
</id>
<property name="userName" column="Name" type="string"/>
<property name="password" type="string"/>
<property name="emailAddress" type="string"/>
<property name="lastLogon" type="date"/>
</class>
</hibernate-mapping>

Java code:
Configuration cfg = new Configuration()
.addClass(User.class)
.setProperty(Environment.HBM2DDL_AUTO, "create");

Full Stack Trace:
net.sf.hibernate.MappingException: Error reading resource: hibtest/User.hbm.xml
at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:354)
at hibtest.Main.main(Unknown Source)
Caused by: net.sf.hibernate.MappingException: org.dom4j.DocumentException: Connection refused: co
ct Nested exception: Connection refused: connect
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:293)
at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:351)
... 1 more
Caused by: org.dom4j.DocumentException: Connection refused: connect Nested exception: Connection
used: connect
at org.dom4j.io.SAXReader.read(SAXReader.java:358)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:283)
... 2 more

I am using the latest version of mySQL.

Any information is appreciated.
thanks,
Max


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 04, 2004 4:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Hibernate actually resolves its DTDs locally via the classpath, so that should not be the problem. Turn logging to debug and post the log output.


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.