jakarta-bsf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jiger Patel" <jiger_...@hotmail.com>
Subject Fwd: Re: Setting classpath/classloader does not work in BSF.
Date Sat, 01 Feb 2003 14:24:49 GMT
Hi BSF Developers,
                 I had written the below mail to the users list but got no 
reply. Hope I get some help from you guys atleast.
  Basically I am writting a scriting interface to an Open Source IDE. Where 
in the user selects the scripting engine of his choice & writes scripts or 
evals expressions, etc. Now users can import Java classes too in their 
scripts(obviously). Now these classes/jars are in the same directory where 
the my scripting plugin loads from & is loaded by the same classloader who 
loads the plugin. But for some reason, except beanshell, no other(I tried 
javascript,jython) scripting engine seem to be able to find the 
packages/classes. I even tried setting classloader & explicitly set the 
classpath to bsf.jar, BEFORE invoking any engines, yet except beanshell, 
none of the scripting engines can find org.apache.bsf.
   My question is is there a CVS version or soon to be released that 
contains scripting engine classes that actually override the set 
classpath/classloader methods in *EngineImpl of each engines & invoke 
respective setClasspath methods on their interpreters. for e.g jython would 
call inter.addJar(classPathOrTokenizedPaths) and so on. OR in their 
respective constructors would addJars/Classpath to their lower level 

I am really stuck & can't proceed further. Can you help me out. is this 
taken care in 2.4 or 3.0 or something?

Thanks a lot,

>From: "Jiger Patel" <jiger_ptl@hotmail.com>
>Reply-To: "Bean Scripting Framework users" <bsf-user@jakarta.apache.org>
>To: bsf-user@jakarta.apache.org
>Subject: Re: Dynamic Classpaths with BSF
>Date: Fri, 31 Jan 2003 20:12:47 +0530
>Funny. My Scripting app works fine using Beanshell. Does jython, javascript 
>etc engines ignore the ClassLoader that loaded them?? Since it works with 
>beanshell, ideally it should work for ALL scripting environments. Is there 
>any plan to make setClassPath compulsory for ENgines to implement. If it is 
>done so then such problems can be resolved easily.
>Any ideas BSF Developers?
>>From: "Jiger Patel" <jiger_ptl@hotmail.com>
>>Reply-To: "Bean Scripting Framework users" <bsf-user@jakarta.apache.org>
>>To: bsf-user@jakarta.apache.org
>>Subject: Dynamic Classpaths with BSF
>>Date: Thu, 30 Jan 2003 18:17:56 +0530
>>Hi All,
>>        I am new to the List & BSF so forgive my ignorance. I searched the 
>>archives & google but did not find any tip on my problem so I hope I will 
>>get some answer here.
>>My Problem is this:
>>I am creating a scripting app where the classes are not set in the 
>>classpath since they are loaded by the parent app from its lib directory. 
>>Now I want to somehow set the classpath/classloader such that all the 
>>classes/jars that I add to BSFManager can be resolved by the various 
>>scripting engines. I tried setting this using setClassPath & 
>>setClassLoader but yet, jython/beanshell etc scripting engines cannot find 
>>the package org.apache.bsh which is there in the lib directory. On 
>>investigating the source code. It seems the BSFManager's classpath & 
>>classloaders are not used by the Scripting Engines in anyway to facilitate 
>>such dynamic classpaths.
>>Now I have this requirement very urgent & need to load jars for a 
>>particular designated directory at runtime when I create BSFManager 
>>instance. Is there some way to force engines to add the mentioned classes. 
>>I don't want to mess with ClassLoaders so setting classpath is what I am 
>>looking at.
>>Any idea how this can be achieved.
>>Thanks in Advance,
>>Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
>>To unsubscribe, e-mail: bsf-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: bsf-user-help@jakarta.apache.org
>The new MSN 8: smart spam protection and 2 months FREE*  
>To unsubscribe, e-mail: bsf-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: bsf-user-help@jakarta.apache.org

Protect your PC - get McAfee.com VirusScan Online 

View raw message