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
|