Tom:

Thanks for all your help. Sometimes a fresh set of eyes can really help. The problem was a misspelled path on the OJB.properties location.

Now you can get back to your usual task of helping solve real OJB problems.

thanks again.
Brad

At 06:31 PM 6/15/2004 +0200, you wrote:
Bradford Pielech wrote:

Tom:

Thanks for the pointer, but it still isn't working. Here is some sample code inside the RMI server that illustrates the failure:


String s = RMIClassLoader.getClassAnnotation(PersistenceBrokerFactory.class);
ClassLoader cl = RMIClassLoader.getClassLoader(s);
org.apache.ojb.broker.util.ClassHelper.setClassLoader(cl);
PersistenceBroker pbroker = PersistenceBrokerFactory.defaultPersistenceBroker();
System.out.println("PBroker: " + pbroker.toString());


This produces the error:

-------
[BOOT] ERROR: Creation of PersistenceBrokerFactory (PBF) instance failed, can't get PBF class object
------



Any other ideas?

Hmm, I'm by no means an RMI expert (at least in environments where performance is not an issue, I'd rather use XML-RPC), but I wonder whether the RMI classloader is correctly initialized to find OJB classes, or whether OJB is correctly configured.
Have a look into your OJB.properties file to see what the persistence broker factory class is that would used (property PersistenceBrokerFactoryClass). If this property is not defined, then the above error results (there is no default value for this property). If it is defined, then either the OJB.properties file could not be loaded (you should see this in the same log where the above error message was output), or the class could not be loaded.
In the first case, the OJB.properties file could probably not loaded (you can set its path manually using the system property "OJB.properties" prior to using *any* OJB class).
In the latter case, please try to load the class directly using the RMI classloader:


Class.forName(classname, true, cl);

and see what happens then.

Tom


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



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



Reply via email to