More details:
I apologize for not trying this *before* I posted, but it didn't occur to me
until just after.
When I comment out the '<field name="product"... ' element from the mapping,
it works just fine. The whole field element, from open tag to close tag. So
what does that imply? For the mapping format, I followed the "jdo" example
included with Castor 0.9.4.2; I'm not sure why the link to the Product class
would break it.
And yes, the Product class does exist, and so does the corresponding
Products SQL table.
Thanks again,
Rob
----- Original Message -----
From: "Robert Kent" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 29, 2003 6:05 PM
Subject: [castor-dev] DataObjectAccessException with cause not set
> Hi -
>
> My application is throwing an exception where it used to work. The
> exception is as follows:
>
> org.exolab.castor.jdo.DataObjectAccessException: Field invocation error
>
> I say it "used to work", what's changed is that I've added a lot of fields
> to the class and to the mapping. I see from the castor source code
> (FieldMolder.java) that this exception is a result of an
> InvocationTargetException being thrown in FieldMolder.addValue() .
>
> What's frustrating me is that "Field invocation error" is very general,
and
> I'm not sure which field caused the error. If someone could help me
figure
> out what that error means, in general, I'd appreciate it. Anyway, some
more
> detail about the situation.
>
> I'm running in a Tomcat context, using the Castor code in a bean. With
> try/catch clauses, I identified that the following piece of code produces
> the error:
>
> // code above here intializes db without error...
> // next line does not wrap; entire string literal is on one line.
> OQLQuery query = db.getOQLQuery("SELECT s FROM
> com.tryarc.forecast.Configuration s WHERE id=$1");
> query.bind(1);
> System.out.println("Query assigned, about to execute...");
> QueryResults results = query.execute();
> System.out.println(results.size());
> config = (Configuration)results.next();
> db.commit();
>
> The Configuration class is as follows:
>
> public class Configuration implements java.io.Serializable {
> private int id;
> //...
> }
>
> Well, it's longer, but basically, the accessor and mutator methods just
> fetch and assign the ID, respectively. The mapping for that class:
>
> <class name="com.tryarc.forecast.Configuration"
> identity="id" key-generator="IDENTITY">
> <map-to table="Configurations"/>
> <field name="id" type="integer">
> <sql name="ConfigID" type="integer" />
> </field>
> <field name="name" type="string">
> <sql name="ConfigName" type="char" />
> </field>
> <field name="description" type="string">
> <sql name="ConfigDescription" type="char" />
> </field>
> <field name="price" type="double">
> <sql name="ConfigPrice" type="double" />
> </field>
> <field name="cost" type="double">
> <sql name="ConfigCost" type="double" />
> </field>
> <field name="mix" type="double">
> <sql name="ConfigMix" type="double" />
> </field>
>
> <field name="product" type="com.tryarc.forecast.Product"
> required="false" direct="false" lazy="false" transient="false">
> <sql name="Config_ProductID" dirty="check" />
> </field>
> </class>
>
>
> thanks for any help,
> _________________________________
>
> Robert Kent - (617) 413-3510
> http://www.rjk-comm.com/
> _________________________________
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev