I'm trying to let ojb ( http://db.apache.org/ojb ) work with Eclipse(3.0 M2), but failed at the first step: initializing PersistenceBroker. My initial code is very simple, just two line added to the plugin class:
if(broker == null){ broker = PersistenceBrokerFactory.defaultPersistenceBroker(); }
I have traced into ojb, finally find that this is related to class loader, then I modified one line of ojb code, in org.apache.ojb.broker.util.ClassHelper, from:
public static Class getClass(String className, boolean initialize) throws ClassNotFoundException { return Class.forName(className, initialize, Thread.currentThread().getContextClassLoader());
}
to:
public static Class getClass(String className, boolean initialize) throws ClassNotFoundException { //return Class.forName(className, initialize, Thread.currentThread().getContextClassLoader()); return Class.forName(className); }
you see, I just ignore the next two parameters passed to the method Class.forName, thought it is not a good idea.Then , broker is created, and everything seems works fine.
So my question is: is it safe to ignore the two parameters in Class.forName? if not, how to fix the problem? modify ojb or modify eclipse?
thanks in advance!
linuxman
_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
