You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bsf-user@jakarta.apache.org by "Little, Alisdair" <AL...@clinphone.com> on 2003/05/14 14:00:47 UTC

BSF and Rhino

Hi,

I've recently started using BSF and Rhino and would like some help...

When I execute my Java code I get the following exception, which is raised by the eval method.

java.lang.NoSuchMethodError:
org.mozilla.javascript.Context.getDebuggableEngine()Lorg/mozilla/javascript/debug/DebuggableEngine;
	at org.apache.bsf.engines.javascript.JavaScriptEngine.eval(Unknown Source)
	at org.apache.bsf.BSFManager$5.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.bsf.BSFManager.eval(Unknown Source)
	at DoItAgain.main(DoItAgain.java:42)
Exception in thread "main"

Even with valid javascript I am still getting this error.
I've attached the source below which I'm running from the eclipse platform.
Any help greatly appreciated.

Thanks,

Al Little.


import org.apache.bsf.BSFManager;
import org.apache.bsf.BSFEngine;

public class DoIt
{
	public static void main(String[] args)
	{
		BSFManager manager = new BSFManager();	
		String language = "javascript";
		String scriptText = "please generate a javascript error";

		System.out.println("Evaluating: \n{\n" + scriptText + "\n}");
		System.out.println("Language: " + language);

		try
		{
			BSFEngine engine = manager.loadScriptingEngine(language);
		}
		catch (Exception e)
		{
			System.err.println(e);
		}

		Object result = null;
		try
		{
			result = manager.eval(language, "Evaluator", 0, 0, scriptText);
		}
		catch (Exception e)
		{
			System.err.println(e);
		}
	}
}

Re: BSF and Rhino

Posted by "Victor J. Orlikowski" <vj...@dulug.duke.edu>.
On Wed, May 14, 2003 at 01:00:47PM +0100, Little, Alisdair wrote:
> When I execute my Java code I get the following exception, which is raised by the eval method.
> 
> java.lang.NoSuchMethodError:
> org.mozilla.javascript.Context.getDebuggableEngine()Lorg/mozilla/javascript/debug/DebuggableEngine;
> 	at org.apache.bsf.engines.javascript.JavaScriptEngine.eval(Unknown Source)
> 	at org.apache.bsf.BSFManager$5.run(Unknown Source)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at org.apache.bsf.BSFManager.eval(Unknown Source)
> 	at DoItAgain.main(DoItAgain.java:42)
> Exception in thread "main"
> 
> Even with valid javascript I am still getting this error.
> I've attached the source below which I'm running from the eclipse platform.
> Any help greatly appreciated.
> 

Apologies for the late reply.
The error stems from the fact that the debug interface for
Javascript currently in place in BSF is based on Rhino version
1.5R4. The error you are reporting suggests that you are using
an earlier version of Rhino, which may not have debugging support,
or may have a version incompatible with the current version.

I suggest using Rhino 1.5R4, or awaiting a new BSF release - I
intend to remove the debugging support that is currently in place,
due to the limited functionality it provides.

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