As indicated in the subject of my mail, i've got some precisions about my
problem: It's not a problem of not having include js.jar to the classPath...

First precision: I use now a batik1.8pre version (I can't tell you which one
it is... because I don't know where i can see this information in the
files... All I can tell you is that is was the most recent version when I
downloaded it on August 21), and the StackTrace is now different:

################################################
New Stack Trace
################################################
java.lang.NullPointerException
    at
org.apache.batik.bridge.BridgeContext.getInterpreter(BridgeContext.java:566)
    at
org.apache.batik.bridge.BaseScriptingEnvironment.getInterpreter(BaseScriptingEnvironment.java:320)
    at
org.apache.batik.bridge.ScriptingEnvironment.runEventHandler(ScriptingEnvironment.java:391)
    at
org.apache.batik.bridge.ScriptingEnvironment$ScriptingEventListener.handleEvent(ScriptingEnvironment.java:1440)
    at
org.apache.batik.dom.events.EventSupport.fireEventListeners(EventSupport.java:324)
    at
org.apache.batik.dom.events.EventSupport.fireEventListeners(EventSupport.java:366)
    at
org.apache.batik.dom.events.EventSupport.dispatchEvent(EventSupport.java:266)
    at
org.apache.batik.dom.AbstractNode.dispatchEvent(AbstractNode.java:1014)
    at
org.apache.batik.bridge.BridgeEventSupport$Listener.dispatchMouseEvent(BridgeEventSupport.java:403)
    at
org.apache.batik.bridge.BridgeEventSupport$Listener.mouseMoved(BridgeEventSupport.java:316)
    at
org.apache.batik.gvt.event.AWTEventDispatcher.processMouseEvent(AWTEventDispatcher.java:613)
    at
org.apache.batik.gvt.event.AWTEventDispatcher.dispatchMouseEvent(AWTEventDispatcher.java:560)
    at
org.apache.batik.gvt.event.AWTEventDispatcher.dispatchEvent(AWTEventDispatcher.java:399)
    at
org.apache.batik.gvt.event.AWTEventDispatcher.mouseMoved(AWTEventDispatcher.java:211)
    at
org.apache.batik.swing.svg.JSVGComponent$SVGListener$1MouseMovedRunnable.run(JSVGComponent.java:2261)
    at org.apache.batik.util.RunnableQueue.run(RunnableQueue.java:240)
    at java.lang.Thread.run(Thread.java:636)
###########################################################
End of the stack trace
###########################################################


Furthermore, i found what realy was at the root of the problem:

Y try to serialize my SVG documents, with the help of the following
DOMUtilities static methds :

####################################
Code
####################################

            String documentString =
DOMUtilities.getXML(document.getDocument().getDocumentElement());

####################################
End Code
####################################

Then I serialize the string, then I deserialize the string

####################################
Code
####################################

            SVGDocument previewDocument = (SVGDocument)
DOMUtilities.parseXML(documentString, null, null, null, null, f);
####################################
End Code
####################################

And it's when i try to display the previewDocument into any JSVGCanvas that
I get my Exception. The exception is thrown even if I skip the
serialization/deserialization step.

I apologize for aving writen earlier that the documents were the sames in
the two case: I thought it realy was the case, because it was working good
with documents without JavaScript.

Can you help me please?

Thans a lot!

2009/8/26 Helder Magalhães <[email protected]>

> Hi Mathieu,
>
>
> > java.lang.Exception: Unknown language: text/ecmascript
>
> If you mix several equivalent language types ('text/ecmascript' and
> 'text/javascript', for example), be aware that Cameron recently
> committed a fix for unexpected behavior in these cases [1]. This is
> only available in nightly builds and/or by compiling the trunk source
> code yourself.
>
> Also, this issue is commonly caused for not having 'js.jar' (and many
> other jars) included in the classpath. Note that, if you don't
> properly setup the classpath, potentially many other "weird" errors
> such as this one will occur. ;-)  But this is already stated in
> related mailing list threads...
>
>
> > Thanks a lot!
>
> Hope this helps,
>  Helder
>
>
> [1] http://svn.apache.org/viewvc?view=rev&revision=801512
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to