Philipp, this appears to be the same problem/question asked by another posting last night. Here's the response I sent to that request:

I'll try to answer your question, although I'm still somewhat new to OJB myself.

OJB uses RemovalAwareCollection as the default implementation class for holding the collection instance. RemovalAwareCollection implements java.util.Collection. So, when your container class is serialized to the client, it contains a reference to the implementation class (RemovalAwareCollection), which must be available to the client either on the local classpath or via the URL class loader.

You can control the class used for collection handling in the OJB.properties file. Thus, you could write your own class to handle the collection if you want to avoid distributing the OJB jar file.


Steckel, Philipp wrote:


Hello,

i am using the Persistence-Broker API and a mySQL-Database. My Server-Application holds persistent Objects in the following way:

I have a Container-Object called ProductCon, which holds n Product-Objects in a 
Vector. I have made this struct persistent using
a 1:n mapping and it works really fine.

I would like to pass the ProductCon-Object (and the associated Product-Objects) to the Client-Application via RMI.

But after having started the Client-Application, the compiler tells me that the 
Client-App needs the OJB-Libraries, like org.apache.
ojb.broker.util.collections.RemovalAwareCollection. The point is, that I don't want to 
ship the client-app with these libraries. Obviously,
the Persistence-Broker added some sort of Code to the ProductCon- or Product-Objects 
which needs the libraries.

Is there any possibility to configure the Broker or what to solve this problem? I 
would like to just send the Objects via RMI, not the
associated ojb-code.

Here is the code to retreive the objects (like in the Tutorial):

dbBroker = PersistenceBrokerFactory.defaultPersistenceBroker(); query = new QueryByCriteria(ProductCon.class,null); versandvorlageCon = (ProductCon)dbBroker.getObjectByQuery(query);

This is used to store(like in the tutorial):

                dbBroker.beginTransaction();
           dbBroker.store(ProductCon);
           dbBroker.commitTransaction();

I guess, that this is a simple newbie-problem. If there is more information/code needed, please just tell me.

Thanks a lot in advance,

Philipp.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-- Larry V. Streepy, Jr. Senior Vice President and CTO Health Language, Inc.

Reply via email to