I absolutely think you are right. However, I am not much of a Weblogic expert either, nor am I much of an OJB expert :-(. Trying to understand the interaction is very difficult. I am really just hoping someone else has had (and fixed) this problem. It must be pretty common, I would think.
thanks, Bonnie MacKellar software engineer Mobius Management Systems, Inc. [EMAIL PROTECTED] > -----Original Message----- > From: Armin Waibel [mailto:[EMAIL PROTECTED] > Sent: Monday, July 07, 2003 5:15 PM > To: OJB Users List > Subject: Re: Weblogic, threads, and startup errors > > > Hi, > > I'm not an expert in web-environments, but this > seems like a ClassLoader problem. > The thread's ClassLoader try to initialize > OJB again. > Maybe you have to associate the new created > thread with the 'right' ClassLoader using > thread.setContextClassLoader(...)??? > > Maybe I'm completely wrong ;-) > regards, > Armin > > ----- Original Message ----- > From: "Bonnie MacKellar" <[EMAIL PROTECTED]> > To: "OJB Users List" <[EMAIL PROTECTED]> > Sent: Monday, July 07, 2003 10:36 PM > Subject: RE: Weblogic, threads, and startup errors > > > > Well, that is precisely why I was trying this - to ensure > that I have > > no brokers spanning threads. > > > > My code looks like this : > > > > public class AccountUpdater extends Thread > > { > > private PersistenceBroker broker = null; > > > > > > public void run() > > { > > try > > { > > PersistenceBroker broker = > > > PersistenceBrokerFactory.createPersistenceBroker(new > > PBKey("ActiveBill")); > > broker.beginTransaction(); > > AccountInterface acc = retrieveAccountByNumber("1234"); > > broker.commitTransaction(); > > } > > catch (Exception e) > > { > > broker.abortTransaction(); > > System.out.print(e.getMessage()); > > e.printStackTrace(); > > } > > finally { > > broker.close(); > > } > > } > > > > The exception is thrown right at the > createPersistenceBroker step. If > I run > > this so that a new thread is not spawned, there is no > problem. But if > I > > spawn a thread and then call this code, I get the exception. > > > > Again, I need to do this in order to avoid long lived brokers. > > > > Bonnie MacKellar > > software engineer > > Mobius Management Systems, Inc. > > [EMAIL PROTECTED] > > > > > > > -----Original Message----- > > > From: Edson Carlos Ericksson Richter > > > [mailto:[EMAIL PROTECTED] > > > Sent: Monday, July 07, 2003 4:30 PM > > > To: OJB Users List > > > Subject: Re: Weblogic, threads, and startup errors > > > > > > > > > I don't know about you, but I had all kind of strange errors > > > working with > > > long time broker lives... > > > > > > Now, I'm working as in mnemonic code: > > > > > > public void xyzStore( XYZObject o ) { > > > broker = getBroker(); > > > > > > try { > > > broker.store( o ); > > > } catch() { > > > }finally { > > > broker.close(); // this guarantees no mistakes... > > > } > > > > > > } > > > > > > This guarantees that the broker object isn't spawned along > > > threads... And my > > > code works fine! > > > Since the brokers are maintained in a pool, there is not pain > > > in performance > > > (AFAIK). > > > > > > > > > Edson Richter > > > > > > > > > ----- Original Message ----- > > > From: "Bonnie MacKellar" <[EMAIL PROTECTED]> > > > To: "OJB Users List (E-mail)" <[EMAIL PROTECTED]> > > > Sent: Monday, July 07, 2003 5:20 PM > > > Subject: Weblogic, threads, and startup errors > > > > > > > > > I posted a question on Thursday about a mysterious error I am > > > getting when I > > > try to obtain a broker in a thread spawned within my > > > application. It was not > > > answered, perhaps because of the holiday, or perhaps because > > > no one else is > > > doing what we are doing. > > > > > > We are running a servlet based application in Weblogic. I am > > > using rc2 at > > > the moment. As long as I obtain the broker in the main > > > thread, there is no > > > problem. But if I spawn a new thread and try to obtain the > > > broker, I was > > > getting obvious classpath problems - OJB.properties not > > > found, and so forth. > > > > > > I explicitly placed the classpath info for the app in my > > > Weblogic startup > > > file (not good, but I will try anything right now). Doing > > > this, it does find > > > the OJB.properties file, but now I get another odd error : > > > > > > [BOOT] ERROR: The specified class > > > "org.apache.ojb.broker.cache.ObjectCachePerBrokerImpl" does > > > not implement > > > the interface org.apache.ojb.broker.cache.ObjectCache, which is a > > > requirement for the key "ObjectCacheClass". Using default class > > > org.apache.ojb.broker.cache.ObjectCacheDefaultImpl > > > java.lang.NullPointerException > > > at dbtests.AccountUpdater.run(AccountUpdater.java:68) > > > > > > Has anybody ever encountered this error before? Obviously, > > > something goes > > > hideously wrong with the configuration of OJB once threads > > > get into the > > > picture, but what? And again, I do not have this problem as > > > long as the code > > > to obtain the broker is situated in the main thread. > > > > > > thanks, > > > Bonnie MacKellar > > > software engineer > > > Mobius Management Systems, Inc. > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > --- > > > Outgoing mail is certified Virus Free. > > > Checked by AVG anti-virus system (http://www.grisoft.com). > > > Version: 6.0.497 / Virus Database: 296 - Release Date: 4/7/2003 > > > > > > > > > > > --------------------------------------------------------------------- > > > 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] >