This has nothing to do with imports in your source code. The JAR file included with Batik called "js.jar" needs to be on the classpath at runtime.
Michael Bishop -----Original Message----- From: Fennell, Philip [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 18, 2006 11:42 AM To: [email protected] Subject: svg:script error... Can someone tell me if there is an obvious answer to this problem. If I add the following svg:script markup to my SVG that I load into Batik: <svg:script type="text/ecmascript"> <![CDATA[ function test(msgText) { alert(msgText); } ]]> </svg:script> I get this error message on the console when the application loads the SVG file: [java] java.lang.NoClassDefFoundError: org/mozilla/javascript/WrappedException [java] at org.apache.batik.script.rhino.RhinoInterpreterFactory.createInterpreter( Unknown Source) [java] at org.apache.batik.script.InterpreterPool.createInterpreter(Unknown Source) [java] at org.apache.batik.bridge.BridgeContext.getInterpreter(UnknownSource) [java] at org.apache.batik.bridge.BaseScriptingEnvironment.getInterpreter(Unknown Source) [java] at org.apache.batik.bridge.BaseScriptingEnvironment.loadScripts(Unknown Source) [java] at org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown Source) [java] at org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown Source) [java] at org.apache.batik.swing.svg.SVGLoadEventDispatcher.run(Unknown Source) and this is the stuff I'm inporting: // Batik import org.apache.batik.bridge.UpdateManager; import org.apache.batik.dom.svg.SVGOMElement; import org.apache.batik.dom.svg.SVGContext; import org.apache.batik.swing.svg.JSVGComponent; import org.apache.batik.swing.JSVGCanvas; import org.apache.batik.swing.JSVGScrollPane; import org.apache.batik.swing.gvt.GVTTreeRendererAdapter; import org.apache.batik.swing.gvt.GVTTreeRendererEvent; import org.apache.batik.swing.svg.SVGDocumentLoaderAdapter; import org.apache.batik.swing.svg.SVGDocumentLoaderEvent; import org.apache.batik.swing.svg.GVTTreeBuilderAdapter; import org.apache.batik.swing.svg.GVTTreeBuilderEvent; import org.apache.batik.swing.svg.SVGLoadEventDispatcherAdapter; import org.apache.batik.swing.svg.SVGLoadEventDispatcherEvent; import org.apache.batik.script.Window; import org.apache.batik.script.rhino.*; Have I missed something or what? The reason I ask is that what I have done doesn't look a million miles away from the examples on the Batik website. Regards Philip Fennell --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
