Superscript plugin with javascript (Rhino) fails to work
Submitted by Wednesday, 9 April, 2008 - 16:55
on
Hello to all users of this excellent editor
Trying to get SuperScript plugin to work with Rhino:
jEdit4.3pre13 with Java 1.6.0
- Downloaded Rhino 1.7R1 and put the jars js.jar and js-14.jar to ~/.jedit/jars
- Ran jedit from the shell (in order to get output to debug)
- Set superscript script mode to javascript and tried to run print("Hello"), no output in superscript plugin but shell displayed error
java.lang.NoSuchMethodError: org.mozilla.javascript.Context.getDebuggableEngine()Lorg/mozilla/javascript/debug/DebuggableEngine;
- googled and found that I probably should use newer bsf (2.4) (SuperScript has bsf 2.3 included and documentation also states that bsf 2.3+ can be used)
- downloaded newer bsf 2.4.0 and replaced the one in ~/.jedit/jars
- started jedit, it started but displayed error in shell:
7:24:47 PM [error] AWT-EventQueue-0: log4j:WARN No appenders could be found for logger (org.apache.bsf.BSFManager).
7:24:47 PM [error] AWT-EventQueue-0: log4j:WARN Please initialize the log4j system properly.
- tried javascript engine again and got output in superscript
org.apache.bsf.engines.javascript.JavaScriptEngine
- also beanshell engine in superscript did not worked anymore (worked fine with superscript included bsf 2.3) and output to superscript window:
bsh.util.BeanShellBSFEngine
- googled and found out that bsf 2.4.0 needs new common-logging.jar from apache commons, downloaded it (commons-logging-1.1.1.jar) and placed in ~/.jedit/jars
- no change still the error in shell and superscript engines fail to work
- decided to try some manual java trickery:
loaded jedit like this:
java -cp jedit.jar:commons-logging-1.1.1.jar:bsf.jar:bsh-2.0b4.jar:js.jar:js-14.jar org.gjt.sp.jedit.jEdit
(in actual command correct jar paths of course were used)
- that way I got no errors on startup, beanshell engine worked in superscript but rhino javascript (ran print("Hello") still failed displaying:
ReferenceError: "print" is not defined.
and shell displayed:
7:49:35 PM [error] SuperScriptPlugin: JavaScript Error: Internal Error: org.mozilla.javascript.EcmaError: ReferenceError: "print" is not defined.
7:49:35 PM [error] SuperScriptPlugin: org.apache.bsf.BSFException: JavaScript Error: Internal Error: org.mozilla.javascript.EcmaError: ReferenceError: "print" is not defined.
So has anyone got newer bsf or Rhino javascript engine to work with SuperScript? I know that some have got bsf 2.4.0 to work with superscript 0.5pre but I can not find this pre version anywhere.
PS: the shell outputted of course more in all cases but I included only relevant lines in the post. If you want to see more just let me know.
All the best,
Villu
Trying to get SuperScript plugin to work with Rhino:
jEdit4.3pre13 with Java 1.6.0
- Downloaded Rhino 1.7R1 and put the jars js.jar and js-14.jar to ~/.jedit/jars
- Ran jedit from the shell (in order to get output to debug)
- Set superscript script mode to javascript and tried to run print("Hello"), no output in superscript plugin but shell displayed error
java.lang.NoSuchMethodError: org.mozilla.javascript.Context.getDebuggableEngine()Lorg/mozilla/javascript/debug/DebuggableEngine;
- googled and found that I probably should use newer bsf (2.4) (SuperScript has bsf 2.3 included and documentation also states that bsf 2.3+ can be used)
- downloaded newer bsf 2.4.0 and replaced the one in ~/.jedit/jars
- started jedit, it started but displayed error in shell:
7:24:47 PM [error] AWT-EventQueue-0: log4j:WARN No appenders could be found for logger (org.apache.bsf.BSFManager).
7:24:47 PM [error] AWT-EventQueue-0: log4j:WARN Please initialize the log4j system properly.
- tried javascript engine again and got output in superscript
org.apache.bsf.engines.javascript.JavaScriptEngine
- also beanshell engine in superscript did not worked anymore (worked fine with superscript included bsf 2.3) and output to superscript window:
bsh.util.BeanShellBSFEngine
- googled and found out that bsf 2.4.0 needs new common-logging.jar from apache commons, downloaded it (commons-logging-1.1.1.jar) and placed in ~/.jedit/jars
- no change still the error in shell and superscript engines fail to work
- decided to try some manual java trickery:
loaded jedit like this:
java -cp jedit.jar:commons-logging-1.1.1.jar:bsf.jar:bsh-2.0b4.jar:js.jar:js-14.jar org.gjt.sp.jedit.jEdit
(in actual command correct jar paths of course were used)
- that way I got no errors on startup, beanshell engine worked in superscript but rhino javascript (ran print("Hello") still failed displaying:
ReferenceError: "print" is not defined.
and shell displayed:
7:49:35 PM [error] SuperScriptPlugin: JavaScript Error: Internal Error: org.mozilla.javascript.EcmaError: ReferenceError: "print" is not defined.
7:49:35 PM [error] SuperScriptPlugin: org.apache.bsf.BSFException: JavaScript Error: Internal Error: org.mozilla.javascript.EcmaError: ReferenceError: "print" is not defined.
So has anyone got newer bsf or Rhino javascript engine to work with SuperScript? I know that some have got bsf 2.4.0 to work with superscript 0.5pre but I can not find this pre version anywhere.
PS: the shell outputted of course more in all cases but I included only relevant lines in the post. If you want to see more just let me know.
All the best,
Villu