Do you call in your application Thread.setContextClassLoader()? If not,
wrapping calls to execute scripts into something like

ClassLoader old = Thread.getContextClassLoader();
Thread.setContextClassLoader(Loader that you use to load js.jar);
try {
    call script evaluation
} finally {
    Thread.setContextClassLoader(old);
}

then it should help Rhino 1.5R3. It uses Thread.getContextClassLoader()
as a parent loader for generated classes and if that loader can not find
Rhino classes, you will get exactly the problem you described. 

Regards, Igor.



On Sat, 31 May 2003 10:46:24 +0530, "Jiger Patel" <[EMAIL PROTECTED]>
said:
> Hi Igor,
> >
> >Did you install JavaScript js.jar into lib/ext dir in the jdk
> >distribution? If so, you should add it to your classpath as well.
> 
> Well I have not put any js.jar in the lib/ext. Actually I am writting
> this 
> plugin for an Open source IDE that provides scripting support for various 
> scripting engines using BSF. So the plugin jar, the bsf.jar and the 
> languages jar files are in the IDE's jars directory. Now when the IDE
> starts 
> up, it adds ALL the jar inside the "jars" directory to its CL. Thus a
> plugin 
> can access any jar if it is in the "jars" directory. But javascript and 
> jython are the two languages that are reciprocal of each other. One loads 
> fine if I don't touch the classpath(sys property java.class.path) or the 
> IDE's ClassLoader the other (jython) does not recognise the current CL
> but 
> only recog. classes either directly added to it via 
> sys.packageManager.addJar() method. so what I have temporarily done is
> load 
> nothing if language is other than Jython. And if the user selects Jython
> in 
> the dropdown, then I call the Jython hack class which would add ALL the
> jar 
> inside the "jars" directory to sys.packageManager. Now the funniest part
> is 
> that sometimes, no matter what, everything works perfectly fine using the 
> above method, but sometimes(if I figure out the steps then wud let you
> know 
> too but right now it is abrupt) Javascript behaves funny and gives me 
> NoClassDefFound:org/mozilla/javascript/NativeScript. This is really 
> un-intutive and I hope the BSF engine for Javascript is updated for the 
> latest rhino specs(I think it is Rhino 1.5R4.1). THe newer version
> complains 
> about some Debugger class not found. So I am using sometimes-workable
> rhino 
> 1.5R3 which is giving me this strange behaviour.
> 
> Any tips.
> 
> -Jiger
> 
> 
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> _________________________________________________________________
> Attention NRIs! Send money to India. 
> http://server1.msn.co.in/msnleads/citibankrca/citibankrca2.asp Do it in a 
> jiffy!
> 
> 
> ---------------------------------------------------------------------
> 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