Folks,
Any thoughts, tips, pointers appreciated.
I've worked on this for a long time and I'm getting no where. Other than
the source for Squiggle, there are no examples for getting this done that I
can find. It's possible I'm going about it all wrong but, I can't find any
other references, so......
JS.jar is in the build path, I've visually checked it and I get the class
references in the early lines of the code, as I step through in the eclipse
debug view,
My code to invoke the mozilla jscript debugger from my batik svg viewer
fails like so:
java.lang.InstantiationException: org.mozilla.javascript.tools.debugger.Main
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at com.bluepearlsystems.Client.BluePearlViewer.showDebugger(
BluePearlViewer.java:255)
at com.bluepearlsystems.Client.BluePearlViewer.setSVGCanvas(
BluePearlViewer.java:352)
at com.bluepearlsystems.Client.BluePearlViewer.main(BluePearlViewer.java
:179)
255 is marked below, it is o = debuggerClass.newInstance();
on this code:
public static void showDebugger() {
jDebugger();
if (debuggerClass == null) return;
if (debuggerFrame == null) {
Constructor dbgcon = null;
Constructor[] ca = null;
try {
ca = debuggerClass.getConstructors();
int l = ca.length;
dbgcon = debuggerClass.getConstructor(new Class [] {
String.class });
} catch (SecurityException e1) {
log.debug("GetConstructor Security Exception:\n "+e1);
e1.printStackTrace();
}
catch (NoSuchMethodException e1) {
log.debug("GetConstructor No Such Method Exception:\n "+e1);
e1.printStackTrace();
}
Object o = null;
try {
#255 o = debuggerClass.newInstance();
} catch (InstantiationException e2) {
e2.printStackTrace();
} catch (IllegalAccessException e2) {
e2.printStackTrace();
}
debuggerFrame = (JFrame)o;
JS.jar is copied to the same directory as Squiggle.
Squiggle fails after it has started and I click on "Tools", then Script
Debugger" with the following (copied from the dos box):
C:\batik-1.6>java -jar batik-squiggle.jar
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException
at org.apache.batik.apps.svgbrowser.JSVGViewerFrame$Debugger
.<init>(JSVG
ViewerFrame.java:945)
at org.apache.batik.apps.svgbrowser.JSVGViewerFrame.showDebugger
(JSVGVie
werFrame.java:827)
at
org.apache.batik.apps.svgbrowser.JSVGViewerFrame$ToggleDebuggerAction
.actionPerformed(JSVGViewerFrame.java:1871)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased
(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)