Hej Jan, > -----Original Message----- > From: Jan Berkel [mailto:[EMAIL PROTECTED] > > since the NPE is due to missing fields in the metadata, > > I assume that a workaround is to add field-descriptors. > > I added field-descriptors to the class descriptor of the Interface > (Template) and it worked fine, thanks. > > Actually you need field-descriptors in your Interface and > implementing > class, not in the base class itself (as there can be no instances ?). > > I think the documentation on the ojb website is not very > clear or even > erroneous on this point.
I agree that the OJB documentation is not sufficient. Personally, I consider valuable error messages (as opposed to mysterious NPEs) even more important. We have to work on that. > > <SNIP from http://db.apache.org/ojb/tutorial3.html#extents> > 1. A declaration for InterfaceArticle, defining which classes > implement this interface: > > <!-- Definitions for org.apache.ojb.broker.InterfaceArticle --> > <class-descriptor class="org.apache.ojb.broker.InterfaceArticle"> > <extent-class class-ref="org.apache.ojb.broker.Article" /> > <extent-class class-ref="org.apache.ojb.broker.BookArticle" /> > <extent-class class-ref="org.apache.ojb.broker.CdArticle" /> > </class-descriptor> > </SNIP> > > It doesn't give a hint to include field-descriptors for the > interface, or does my setup just happen to be special ? > Moreover, having the obligation to add field descriptors to the > interface is not very practical when using the xdoclet-ojb > module (where > you have to define the mappings on the instance fields), or > is there a workaround ? Sorry, I have no experience with the xdoclet-ojb module. You might start a new thread with that question. Olli --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
