My 2 cents:
castor.jar is another library and therefore it is Ok to put it in the class
path with other libraries. This argument is further strengthened by your
problems. Unfortunately, I can't help you with your problem but I do wonder
why you're bothering with it at all. Why don't you do class loading the
default way, which is through class path? If there is some kind of a limit
to the classpath length, try using relative paths cause they're usually
shorter than the absolute ones. Why invest effort into something which is
already taken care of by the JVM???

Alex



-------------------------------------------
Privileged or confidential information may be contained in this message. If
this message was not intended for you, destroy it and notify us
immediately.Opinions, conclusions, recommendations, and other information
presented in this message are not given or necessarily endorsed by my
employer or firm.


> -----Original Message-----
> From: Youri Canetti [mailto:[EMAIL PROTECTED]]
> Sent: January 4, 2002 7:09 AM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] loading castor.jar as an extension: ClassLoader
> problems
>
>
> Adding castor.jar as yet another library has triggered in our
> project a new
> strategy for loading the libraries:
> instead of adding them in the classpath (which tends to grow indefinitely
> for large projects), we decided to use the "-Djava.ext.dirs" command-line
> option of the JVM. We keep on using the classpath for our code (esp. in
> development cycle)
> This works for 100% of our code, 100% of other library's code, and 95% of
> Castor's code.
> here is the description of the remaining percents:
>
> we use
>    Configuration.getDefault().setProperty(Configuration.Property.RegExp,
> MyRegExpEvaluator.class.getName());
> to specify ou own regexp evaluator.
>
> unfortunately, when calling Configuration.getRegExpEvaluator() (which is
> done by castor), a NoClassDefFoundError is thrown.
> This is because Configuration.class is loaded by the extension
> ClassLoader,
> which has no knowledge of the classloader that uses the classpath. The
> problem is very well described here:
> http://www.javageeks.com/Papers/ClassForName/ClassForName.pdf
>
> One solution would be to rewrite some calls of Class.forName(aClass):
> Class.forName(aClass, bResolve, ClassLoader.getSystemClassLoader())
>
> What do you think?
>
> thanks
>
> youri
>
> -----------------------------------------------------------
> 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