Martin Fuchs wrote:
Hi,
when trying to use the current CVS version of Castor I get the following Exception message:
unable to find FieldDescriptor for 'data-source' in ClassDescriptor of jdo-conf org.xml.sax.SAXException: unable to find FieldDescriptor for 'data-source' in ClassDescriptor of jdo-conf at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1793) at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1292) at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376) at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1197) at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1862) at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1238) at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1035) at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:605) at org.exolab.castor.jdo.engine.JDOConfLoader.loadConfiguration(JDOConfLoader.java:85) at org.exolab.castor.jdo.engine.JDOConfLoader.getDatabase(JDOConfLoader.java:101) at org.exolab.castor.jdo.engine.DatabaseRegistry.loadDatabase(DatabaseRegistry.java:235) at org.exolab.castor.jdo.JDO.getDatabase(JDO.java:571) at DeptEmp.run(DeptEmp.java:34) at DeptEmp.main(DeptEmp.java:12)
This occures regardless of using a <driver ...> configuration or a <data-source ...> configuration in the database configuratin file.
Here is an example database.xml file I tried:
<?xml version="1.0" ?> <!DOCTYPE databases PUBLIC "-//EXOLAB/Castor JDO Configuration DTD Version 1.0//EN" "http://castor.exolab.org/jdo-conf.dtd">
<database name="oracle" engine="oracle" > <driver url="jdbc:oracle:thin:@localhost:1521:TEST" class-name="oracle.jdbc.driver.OracleDriver"> <param name="user" value="test"/> <param name="password" value="secret"/> </driver> <mapping href="mapping.xml" /> </database>
Martin,
This is because Werner and I have enhanced this descriptor to begin to allow various configuration parameters. Below is a descriptor that works correctly for PostgreSQL:
<jdo-conf>
<database name="postgresql" engine="postgresql" >
<driver class-name="org.postgresql.Driver" url="jdbc:postgresql:castor_tests">
<param name="user" value="test"/>
<param name="password" value="" />
</driver>
<mapping href="mapping.xml" />
</database>
<transaction-demarcation mode="local">
<transaction-manager name="local" />
</transaction-demarcation>
</jdo-conf>
Notice the addition of the <jdo-conf> and <transaction-demarcation> elements. These two elements have been added. The <transaction-demarcation> element is used to tie directly into a specific tx manager (e.g. from an app server). The doc for this element is not currently available on the website. However, if you build the Castor javadocs yourself, you'll find the doc for this element/class in the javadoc for the org.exolab.castor.jdo.transactionmanager package.
Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\\"F9E<G)E=\\$\\!F<FEI+F-O;0\\`\\`");'
The Castor Project http://www.castor.org/
Apache Geronimo http://incubator.apache.org/projects/geronimo.html
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
