jakarta-bsf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shank, Gary" <Gary_Sh...@stercomm.com>
Subject RE: BSF Questions
Date Fri, 14 Feb 2003 17:59:10 GMT
Thanks for the reply.  As for the beanshell problem, the printStackTrace
results are:
unable to load language: beanshell: 
java.lang.NoClassDefFoundError: com/ibm/bsf/util/BSFEngineImpl
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:243)
at java.net.URLClassLoader.access$100(URLClassLoader.java:51)
at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
at javax.management.loading.MLet.findClass(MLet.java:775)
at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at org.apache.bsf.BSFManager.loadScriptingEngine(Unknown Source)
at org.apache.bsf.BSFManager.exec(Unknown Source)
at
com.sterlingcommerce.woodstock.services.bsf.BSFImpl.processData(BSFImpl.java
:136)

I'm using BSF v2.3 and BSH-1.2b7.jar but the class not being found above
exists in BSF v2.2 from IBM.  I don't know if this class should be in bsf's
2.3 jar or in bsh's jar but it's not in either.  I tried throwing in the 2.2
version of bsf but then I get.
java.lang.ClassCastException: bsh.util.BeanShellBSFEngine
Gary


-----Original Message-----
From: Victor J. Orlikowski [mailto:vjo@dulug.duke.edu]
Sent: Thursday, February 13, 2003 04:34 AM
To: 'bsf-user@jakarta.apache.org'
Subject: Re: BSF Questions


On Thu, Jan 23, 2003 at 04:12:18PM -0500, Shank, Gary wrote:
> I'm writing an app that can execute scripts using BSF v2.3.0.  I would
like
> to be able to handle any of the available/supported scripting languages
> which has prompted the following questions:
>  
> 1. Can I register and load scripting engines for all available scripting
> languages/engines using one manager?  Example:
>     BSFManager mgr = new MSFManager();
>     mgr.registerScriptingEngine("engine1", "engine1.Engine", ext1);
>     mgr.registerScriptingEngine("engine2", "engine2.Engine", ext2);
>     mgr.loadScriptingEngine("engine1");
>     mgr.loadScriptingEngine("engine2");
>  
Yes. A single BSFManager instance can handle multiple 
scripting engines simultaneously.

> 2. I'm trying to register and load the BeanShell scripting language
> (bsh-1.2b7.jar) - the register works but the load fails with "unable to
load
> language - BSFException.REASON_OTHER_ERROR".
>     String[] ext_bsh = {"bsh"};
>     mgr.registerScriptingEngine("beanshell",
"bsh.util.BeanShellBSFEngine",
> ext_bsh);
>     BSFEngine bshEngine = mgr.loadScriptingEngine("beanshell");
>  
Hum. That error indicates some problem w/ instantiating a
bsh.util.BeanShellBSFEngine object or running it's initialize()
method. Could you please do a printStaceTrace() on the
BSFException (try/catch block around loadScriptingEngine) and
reply w/ the output?

> 3. When I was using the jython engine - when I called the
> loadScriptingEngine method for the first time, it took a very long time
and
> I noticed that a "cachedir" was added to the directory where the bsf.jar
was
> located.  Why and what's it for?
>  
Jython caches Java package information in order to optimize its
performance. As part of this procedure, it creates the cachedir
directory heirarchy. The initial waiting period was probably due
to the initial scan for the cache creation.

Hope that helps,
Victor
-- 
Victor J. Orlikowski   | The Wall is Down, But the Threat Remains!
==================================================================
orlikowski@apache.org  | vjo@dulug.duke.edu | vjo@us.ibm.com

---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-user-help@jakarta.apache.org

Mime
View raw message