I am getting the following error while running the schema export ant task.
Hibernate version 2.03. If anybody has any idea about this please post a reply. It appears as if the parser is complaining that the xml file isn't conforming to the DTD but I am puzzled why. Some other vital information is at the end of the stack trace. I am willing to send any more information if someone would like to help me.
please scroll down a little for complete stacktrace
SEVERE: Error parsing XML: D:\<path shortened>\AccountInformationTypeImpl.hbm.xml(32)
org.xml.sax.SAXParseException: Attribute "access" must be declare
d for element type "property".
The .hbm.xml file was generated by XDoclet 1.2.1.
here is an excerpt from the .hbm.xml file.
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class
name="com.package.AccountInformationTypeImpl"
dynamic-update="false"
dynamic-insert="false"
>
<id
name="id"
column="id"
type="string"
length="36"
unsaved-value="any"
>
<generator class="assigned">
</generator>
</id>
<property
name="externalAccountNumber"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="externalAccountNumber"
/>
Complete stacktrace
Code:
SEVERE: Error parsing XML: D:\<path shortened>\AccountInformationTypeImpl.hbm.xml(32)
org.xml.sax.SAXParseException: Attribute "access" must be declare
d for element type "property".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseExce
ption(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Sour
ce)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown S
ource)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown S
ource)
at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrs
AndValidate(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement
(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElem
ent(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragmen
tContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDoc
ument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown So
urce)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown So
urce)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Sou
rce)
at org.dom4j.io.SAXReader.read(SAXReader.java:339)
at org.dom4j.io.SAXReader.read(SAXReader.java:219)
at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java
:155)
at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.getConfigurati
on(SchemaExportTask.java:184)
at net.sf.hibernate.tool.hbm2ddl.SchemaExportTask.execute(Schema
ExportTask.java:128)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.ja
va:269)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:301)
at org.apache.tools.ant.Target.performTasks(Target.java:328)
at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at org.apache.tools.ant.Project.executeTargets(Project.java:1063
)
at org.apache.tools.ant.Main.runBuild(Main.java:632)
at org.apache.tools.ant.Main.startAnt(Main.java:183)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
Jul 21, 2004 10:04:20 AM net.sf.hibernate.util.XMLHelper$ErrorLog
ger error
-----------------------------------------------------------------------------------
ANT task for schema export
<schemaexport
properties="${hibernate.properties}"
quiet="yes"
text="yes"
drop="no"
delimiter=";"
output="${database}/schema.sql">
<fileset dir="${hibernate.mapping}">
<include name="**/Account*.hbm.xml"/>
</fileset>
</schemaexport>
-----------------------------------------------------------------------------------
hibernate.properties relevant section
## HypersonicSQL
hibernate.dialect net.sf.hibernate.dialect.HSQLDialect
hibernate.connection.driver_class org.hsqldb.jdbcDriver
hibernate.connection.username sa
hibernate.connection.password
hibernate.connection.url jdbc:hsqldb:database/hsql/test
---------------------------------------------