@max
sorry, but i think i'm just to stupid :(
I've got an problem triing the "toString"-Patch ...
This exception is making me crazy:
Code:
Caused by: org.xml.sax.SAXParseException: Document root element "hibernate-confi
guration", must match DOCTYPE root "hibernate-configuration".
at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1318
)
at org.apache.xerces.validators.dtd.DTDValidator.reportRecoverableXMLErr
or(DTDValidator.java:1602)
at org.apache.xerces.validators.dtd.DTDValidator.rootElementSpecified(DT
DValidator.java:576)
at org.apache.xerces.framework.XMLParser.callStartElement(XMLParser.java
:1903)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.disp
atch(XMLDocumentScanner.java:980)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
canner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1208)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1213)
... 18 more
--- Nested Exception ---
For testing i've copied the "hibernate.cfg.xml" from "Configuration.xml" and my WDSC says "The XML is valid according to DTD".
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>
<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory
name="java:hibernate/SessionFactory">
<!-- properties -->
<property name="connection.datasource">java:/comp/env/jdbc/MyDB</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">false</property>
<property name="transaction.factory_class">
org.hibernate.transaction.JTATransactionFactory
</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>
<!-- mapping files -->
<mapping resource="org/hibernate/auction/Item.hbm.xml"/>
<mapping resource="org/hibernate/auction/Bid.hbm.xml"/>
<!-- cache settings -->
<class-cache class="org.hibernate.auction.Item" usage="read-write"/>
<class-cache class="org.hibernate.auction.Bid" usage="read-only"/>
<collection-cache collection="org.hibernate.auction.Item.bids" usage="read-write"/>
</session-factory>
</hibernate-configuration>
This is my test-build.xml
Code:
<project name="hbtest">
<taskdef
name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask">
<classpath>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</classpath>
</taskdef>
<target name="test">
<hibernatetool destdir=".">
<configuration configurationfile="./hibernate.cfg.xml"/> <!-- annotated class/packages are specified in the hibernate.cfg.xml -->
<hbm2java/>
</hibernatetool>
</target>
</project>
I'm quite sure that i've done something stupid wrong, but searching in the forum doesn't help me ... therefore i've thought "try it with the config from docs" ... but that doesn't work either ...
Sources from HB3 and HBExt are from CVS.
It's a little bit awkward ... but i'm to stupid for that :(
Could you please help me out?
gtx
curio