I am getting the following error when I call jdo.getDatabase:
----------------------------------------------------------------------
expression "tmpPersistenceException:
org.exolab.castor.jdo.PersistenceException={org.exolab.castor.jdo.DatabaseNotFou
ndException@404}
detaiMessage: java.lang.String="Nested error
org.exolab.castor.mapping.MappingException: Could not find class id"
----------------------------------------------------------------------
tmpPersistenceException is the variable that I use to catch getDatabase()
exceptions. The "expression" and "detailMessage" from above are what is
displayed in the JBuilder4 debug watch window after I expand
tmpPersistenceException.
The database that I am trying to use is an interbase database that I created
using IBWorkbench.
The database.xml file looks like this:
----------------------------------------------------------------------
<!DOCTYPE databases PUBLIC "-//EXOLAB/Castor JDO Configuration DTD Version
1.0//EN"
"http://castor.exolab.org/jdo-conf.dtd">
<database name="incidents" engine="interbase" >
<driver class-name="interbase.interclient.Driver"
url="jdbc:interbase://localhost/c:\program files\borland\interclient">
<param name="user" value="SYSDBA"/>
<param name="password" value="masterkey"/>
</driver>
<mapping href="mapping.xml" />
</database>
---------------------------------------------------------------------
The mapping.xml file looks like this:
--------------------------------------------------------------------------
<!DOCTYPE databases PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"
"http://castor.exolab.org/mapping.dtd">
<mapping>
<class name ="test.Incident" access="shared" identity="id">
<map-to table="Incident" />
<field name="id" type="string" >
<sql name="incidentid" type="varchar"/>
</field>
<field name="product" type="string">
<sql name="product" type="varchar"/>
</field>
...
</class>
</mapping>
--------------------------------------------------------------------------
The code is as follows:
--------------------------------------------------------------------------
jdo = new JDO();
jdo.setDatabaseName("incidents");
jdo.setConfiguration("database.xml");
jdo.setClassLoader(getClass().getClassLoader());
try {
map = new Mapping(this.getClass().getClassLoader());
map.loadMapping("mapping.xml");
ir = new IncidentReader(); //reads in an incident from an XML file
try {
db = jdo.getDatabase();
db.begin();
db.create(ir.incident);
db.commit();
db.close();
}
catch (org.exolab.castor.jdo.PersistenceException tmpPersistenceException)
{
}
}
catch (org.exolab.castor.mapping.MappingException tmpMappingException) {
}
catch (java.io.IOException tmpIOException) {
}
}
------------------------------------------------
Thanks in advance for any help.
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev