Its been interesting hearing all this banter on the Beanshell-users mailing list but .......

Can anyone answer my previously posted question below, or is there perhaps another mailing list where the developers support the users of this fantastic java scripting tool ?

Many thanks

On 18 May 2005, at 17:15, Colin Bell wrote:

Hi all

I am having a terrible time getting a script to work in beanshell. I should note that the application is hosted by OC4J.

My error is:

There was an error in evaluating the script:Sourced file: inline evaluation of: ``setNameSpace(this.caller.namespace);  addClassPath( "c:/oc4j_extended/j2ee/home/ . . . '' : Typed variable declaration : Class: thisBean not found in namespace : at Line: 4 : in file: inline evaluation of: ``setNameSpace(this.caller.namespace);  addClassPath( "c:/oc4j_extended/j2ee/home/ . . . '' : thisBean

The script (which works fine from a compiled source) is as follows:

setNameSpace(this.caller.namespace); // this was to see if it helped
addClassPath( "c:/oc4j_extended/j2ee/home/myapp/WEB-INF/classes");
thisBean myBean=new thisBean();

The code that runs it is (code being the above script):

private void eval(String code) throws Exception {
    try {
            Interpreter i = new Interpreter();
        catch ( TargetError e ) {
            logMessage("The script or code called by the script threw an exception: " + e.getTarget());
        catch ( EvalError e2 )    {
            logMessage( "There was an error in evaluating the script:" + e2 ); 

if I print out the namespace its is "global (bsh.Namespace@...)

I think OC4j might be limiting the getResource command?

many thanks