Hi,

We had a similar problem when running on castor under WinRunner environment. When 
castor loads persistent libraries it calls Class.getClassLoader(). Here is an 
extraction from function's javadoc:

        "Returns the class loader for the class. Some implementations may use null to 
represent the bootstrap class loader. This method will return null in such 
implementations if this class was loaded by the bootstrap class loader. "

I added the following to handle the issue

 Instead of line in KeyGeneratorFactoryRegistry.java and 
PersistenceFactoryRegistry.java :

        cls = KeyGeneratorFactoryRegistry.class.getClassLoader().loadClass( prop );

 I put the following:

        cls = getClassLoader().loadClass( prop );

        protected static ClassLoader getClassLoader()
        {
                ClassLoader cl = PersistenceFactoryRegistry.class.getClassLoader();
                if(cl == null)
                {
                        // if the class is loaded by the
                        // bootstrap class loader get
                        // the default one.
                        cl = ClassLoader.getSystemClassLoader();
                }
                return cl;
        }

Hope this helps,
Alex

-----Original Message-----
From: John Weir [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 10:42 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] URGENT: Potential bug in PersistenceFactoryRegistry on 
Solaris w/JDK 1.4 & Tomcat 4.0.4


Might be a red herring, but Check your patch levels on Solaris with JDK1.4.
You need to be running nearly all the latest patches - or weird behaviour
ensues

J
----- Original Message -----
From: "Ryan McDonough" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 24, 2002 7:56 PM
Subject: [castor-dev] URGENT: Potential bug in PersistenceFactoryRegistry on
Solaris w/JDK 1.4 & Tomcat 4.0.4


> So here's the deal. I've been trying to track a but with Castor for the
past
> week where on Solaris 8 (running JDK 1.4.0_02 and Tomcat 4.0.4 w/ MySQL
> Connector/J 2.0.14 and Castor 0.9.3.21) Castor is unable to locate any of
> the persistence factory classes when getDatabase() is called. The odd
thing
> is that This web app is running fine, with similar configs on both Windows
> 2000/JDK 1.4.0_02 and Mac OS X 10.2/JDK 1.3.1. After some digging and
review
> of some of Castors code, it became apparent that this was a class loader
> issue. So to test, I checked out the sources from CVS, put some print
> statements in the PersistenceFactoryRegistry to see what classloader was
> being used when the load() method was called. On MacOS X and Win2k, this
> returned a proper class path. On Solaris however, it returns null.
>
>
> Just to restate, we are using a binary build of Tomcat 4.0.4 from Jakarta
> and Sun JDK's and the App is working fine on Windows 2000 and Mac OS X.
I'd
> like to know if anyone can replicate this bug or offer any insight as to
> what is going on? Thanks.
>
> Ryan-
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
> unsubscribe castor-dev
>

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to