jakarta-bsf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rony G. Flatscher" <Rony.Flatsc...@wu-wien.ac.at>
Subject Re: NetRexx 2.x / BSF2.3 issue getting "current" BSFManager instance...
Date Tue, 14 Jan 2003 12:03:54 GMT

>C:\wkw\work\RexxRules\bsf-2.3.0\UIsample>NetRexxC ui.nrx
O.K., I see: this cannot work! You are invoking you are trying to 
compile the NetRexx program yourself., which leads to this particular error.

Instead, you must invoke the NetRexx program directly from Java via BSF! 
The NetRexx support of BSF should take care of compiling your NetRexx 
program and making the object "bsf" available to the NetRexx program!

>NetRexx portable processor, version 2.02
>Copyright (c) IBM Corporation, 2001.  All rights reserved.
>Program ui.nrx
>  6 +++ p = java.awt.Panel bsf.lookupBean("centerPanel");
>    +++                    ^^^
>    +++ Error: The method 'bsf.lookupBean(java.lang.String)' cannot be
>found in
>class 'ui' or a superclass
>Compilation of 'ui.nrx' failed [one error]
Yup, the object "bsf" should be brought in by BSF and therefore  be 
implicitly available to your NetRexx program.

>This is one of the specific cases of my general problem:  I can't seem to
>get a reference to the "running" BSF environment from within the script,
>any successful attempts to do so (e.g. bsf=BSFManager()) put me at
>cross-purposes with what I'm trying to accomplish.  Am I missing some
>or something?  I don't see how this could be, since the "static" (not in a
>sense) import would somehow have to reference this dynamic, runtime object
>which represents the thing that gets created in my Java code when I
>instantiate a BSFManager.
Well, if you instantiate a BSFManager the next step would be to load a 
particular programming language engine, which in turn you would give the 
source code of a NetRexx program to be executed.

For this reason, if you wish to run the supplied sample, you first need 
to compile the Java program ("ScriptedUI.java", but adapt it to the 
Apache package name first!), e.g. "javac ScriptedUI.java" and make sure 
that the Apache bsf-package is in the classpath. After that you start 
the compiled Java program and give it as an argument the name of that 
file which contains the script in source code, hence:

>Enclosed you'll find a little archive with a sample using a
>NetRexx-script. The sample stems from the IBM distribution, so you would
>need to change the "bsf" package name to Apache's. After recompiling the
>Java-file, you should be able to enter the following:
>    java ScriptedUI ui.nrx
>which then should create an awt-frame on the Java side and let the
>NetRexx script edit that window from NetRexx.
Maybe, you give it one more try?



View raw message