xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lindberg, Manne" <manne.lindb...@benima.se>
Subject scripting initialization problem in batik1.6 when running webstart
Date Tue, 19 Apr 2005 05:00:33 GMT
Hi

After switching from batik 1.5.1 to 1.6 I fail to call script methods (javascript) when running
the application as a webstart application. It works when I switch back to 1.5.1. It also works
for batik 1.6 if I do not use webstart. Here is the code I use for initialization in an own
defined method callJS() : 
1)
  jSVGCanvas.getUpdateManager().getScriptingEnvironment().getInterpreter().evaluate(scriptstr);
// works with batik151 but not with (batik16 AND webstart)

I also tried the following code (after reading about some problems concerning applet and security)
2)
 Interpreter ipret = jSVGCanvas.getUpdateManager().getBridgeContext().getInterpreter("text/ecmascript");
 ipret.evaluate(scriptstr);

In both cases I get an null pointer exception.

First at startup I get the following exception (as an svg error dialog created by batik package)
java.lang.NullPointerException 	
at org.apache.batik.script.InterpreterPool.createInterpreter(Unknown Source) 	
at org.apache.batik.bridge.BridgeContext.getInterpreter(Unknown Source) 	
at org.apache.batik.bridge.BaseScriptingEnvironment.getInterpreter(Unknown Source) 	
at org.apache.batik.bridge.BaseScriptingEnvironment.getInterpreter(Unknown Source) 	
at org.apache.batik.bridge.BaseScriptingEnvironment.dispatchSVGLoad(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)

and then (when calling "callJS", i.e. evaluating scriptstr) (also as an svg error dialog created
by batik package)
java.lang.NullPointerException 	
at org.apache.batik.script.InterpreterPool.createInterpreter(Unknown Source) 
at org.apache.batik.bridge.BridgeContext.getInterpreter(Unknown Source) 	
at org.apache.batik.bridge.BaseScriptingEnvironment.getInterpreter(Unknown Source) 	
at org.apache.batik.bridge.BaseScriptingEnvironment.getInterpreter(Unknown Source) 	
at com.automine.pcs.gui.plan.ProdPlanGraph.callJS(ProdPlanGraph.java:459) 	
at com.automine.pcs.gui.plan.ProdPlanGraph.addCrusherValue(ProdPlanGraph.java:416) 	
at com.automine.pcs.gui.plan.ProdPlanGraph.update(ProdPlanGraph.java:624) 	
at java.util.Observable.notifyObservers(Unknown Source) 	at java.util.Observable.notifyObservers(Unknown
Source) 	
at com.automine.pcs.gui.plan.ProductionPlan.notifyObs(ProductionPlan.java:416) 	
at com.automine.pcs.gui.plan.ProductionPlan.setCurrentCrusherTons(ProductionPlan.java:97)
	
at com.automine.communication.StatusUpdater.setCurrentCrusherTons(StatusUpdater.java:1174)
	
at com.automine.communication.G2Communication.setCurrentCrusherTons(G2Communication.java:3590)
	
at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source) 	
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 	
at java.lang.reflect.Method.invoke(Unknown Source) 	
at com.gensym.jgi.JGInterface$RunMethodThread.run(JGInterface.java:1876) 	
at com.gensym.jgi.JGInterface$MethodCallQueue.run(JGInterface.java:2005)

I have debugged that the code (callJS) is called after the "gvtRenderingCompleted(GVTTreeRendererEvent
e)".

Does anybody have an idea what could cause this? How to get it work with batik 1.6 and webstart?


Regards

Manne Lindberg
manne.lindberg@benima.se
Benima Mellan Ab
    

Mime
View raw message