You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Vincent Hardy <vi...@sun.com> on 2002/07/08 13:30:02 UTC
Re: Why do I get: Unknown language: text/ecmascript
Hello,
This is due to the input document having a null URL. I'll fix this for
the RhinoClassLoader. In the meanwhile, you can set a dummy URL on the
document, something like:
((SVGOMDocument)doc).setURLObject(new
java.net.URL("file:/c:/temp/dummy.svg"));
Vincent.
J Aaron Farr wrote:
>
> Okay, I'm running a test here trying to load SVG which has been generated by
> the SVGGraphics2D converter to a SVGCanvas object. If anyone knows of an
> easier way let me know.
>
> If I use this method, everything works fine:
>
> String svg = generateSVG(doc);
> System.out.println(svg);
> StringReader sr = new StringReader(svg);
> SAXSVGDocumentFactory df = new
> SAXSVGDocumentFactory("org.apache.xerces.parsers.SAXParser");
> SVGOMDocument svgDoc = df.createDocument(null,sr);
>
> svgCanvas.setSVGDocument(svgDoc);
> // File f = new File("test.svg");
> // svgCanvas.setURI(f.toURL().toString());
>
> java.lang.Exception: Unknown language: text/ecmascript
> at
> org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoadEvent(Unknown
> Source)
> at org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown Source)
>
> at org.apache.batik.swing.svg.SVGLoadEventDispatcher.run(Unknown Source)
>
> java.lang.NullPointerException
>
> at java.net.URLClassLoader.getPermissions(URLClassLoader.java:422)
>
> at org.apache.batik.script.rhino.RhinoClassLoader.getPermissions(Unknown
> Source)
>
> at org.apache.batik.script.rhino.RhinoClassLoader.<init>(Unknown Source)
>
> at org.apache.batik.script.rhino.RhinoInterpreter.<init>(Unknown Source)
>
> at
> org.apache.batik.script.rhino.RhinoInterpreterFactory.createInterpreter(Unknown
> Source)
>
> at org.apache.batik.script.InterpreterPool.createInterpreter(Unknown Source)
>
> at org.apache.batik.bridge.BridgeContext.getInterpreter(Unknown Source)
>
> at
> org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoadEvent(Unknown
> Source)
>
> at org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown Source)
>
> at org.apache.batik.swing.svg.SVGLoadEventDispatcher.run(Unknown Source)
>
> __________________________________________________
> Do You Yahoo!?
> Sign up for SBC Yahoo! Dial - First Month Free
> http://sbc.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: Why do I get: Unknown language: text/ecmascript
Posted by Vincent Hardy <vi...@sun.com>.
Hello again,
I just committed a fix for this problem, so I will not work after you
do a CVS update.
Cheers,
Vincent.
Vincent Hardy wrote:
>
> Hello,
>
> This is due to the input document having a null URL. I'll fix this for
> the RhinoClassLoader. In the meanwhile, you can set a dummy URL on the
> document, something like:
>
> ((SVGOMDocument)doc).setURLObject(new
> java.net.URL("file:/c:/temp/dummy.svg"));
>
> Vincent.
>
> J Aaron Farr wrote:
> >
> > Okay, I'm running a test here trying to load SVG which has been generated by
> > the SVGGraphics2D converter to a SVGCanvas object. If anyone knows of an
> > easier way let me know.
> >
> > If I use this method, everything works fine:
> >
> > String svg = generateSVG(doc);
> > System.out.println(svg);
> > StringReader sr = new StringReader(svg);
> > SAXSVGDocumentFactory df = new
> > SAXSVGDocumentFactory("org.apache.xerces.parsers.SAXParser");
> > SVGOMDocument svgDoc = df.createDocument(null,sr);
> >
> > svgCanvas.setSVGDocument(svgDoc);
> > // File f = new File("test.svg");
> > // svgCanvas.setURI(f.toURL().toString());
> >
> > java.lang.Exception: Unknown language: text/ecmascript
> > at
> > org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoadEvent(Unknown
> > Source)
> > at org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown Source)
> >
> > at org.apache.batik.swing.svg.SVGLoadEventDispatcher.run(Unknown Source)
> >
> > java.lang.NullPointerException
> >
> > at java.net.URLClassLoader.getPermissions(URLClassLoader.java:422)
> >
> > at org.apache.batik.script.rhino.RhinoClassLoader.getPermissions(Unknown
> > Source)
> >
> > at org.apache.batik.script.rhino.RhinoClassLoader.<init>(Unknown Source)
> >
> > at org.apache.batik.script.rhino.RhinoInterpreter.<init>(Unknown Source)
> >
> > at
> > org.apache.batik.script.rhino.RhinoInterpreterFactory.createInterpreter(Unknown
> > Source)
> >
> > at org.apache.batik.script.InterpreterPool.createInterpreter(Unknown Source)
> >
> > at org.apache.batik.bridge.BridgeContext.getInterpreter(Unknown Source)
> >
> > at
> > org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoadEvent(Unknown
> > Source)
> >
> > at org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(Unknown Source)
> >
> > at org.apache.batik.swing.svg.SVGLoadEventDispatcher.run(Unknown Source)
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Sign up for SBC Yahoo! Dial - First Month Free
> > http://sbc.yahoo.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: batik-users-help@xml.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org