Skip to main content

JavaFX ScriptException: compilation failed using JNLP

4 replies [Last post]
nidaya
Offline
Joined: 2006-07-29
Points: 0

Hi,

I try to evaluate JavaFX Script using Java Scripting API with NetBeans 6.1 and the javafx plugin, but the compilation failed when I enable Java Web Start.

It's OK when I run the project without Java Web Start.

This is the code :

public class Main {

public static void main(String[] args) {
DiagnosticCollector diags = new DiagnosticCollector();
try {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
ScriptEngineManager manager = new ScriptEngineManager(loader);
JavaFXScriptEngine jfxse = (JavaFXScriptEngine) manager.getEngineByName("javafx");

StringBuffer sb = new StringBuffer();
sb.append("import javafx.ui.*; ");
sb.append("import javafx.ui.canvas.*; ");
sb.append("import javafx.ui.filter.*; ");
sb.append("Frame { ");
sb.append(" title: \"Title\" ");
sb.append(" background: Color.WHITE ");
sb.append(" visible: true ");
sb.append(" content: SimpleLabel { text: \"Hello World !\" } ");
sb.append("}; ");

jfxse.eval(sb.toString());

} catch (ScriptException ex) {
List errorList = diags.getDiagnostics();
Iterator iter = errorList.iterator();
while (iter.hasNext()) {
Diagnostic d = iter.next();
System.out.println(d.getKind() + " : " + d.getMessage(null));
}
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
}
}

This is the jnlp generated by NetBeans :

<?xml version="1.0" encoding="UTF-8"?>

TestFXScript
Keloud

TestFXScript
TestFXScript

This is the jnlp exception :
----------------------------------------------------
Exception thrown in JavaFX pretty printing: java.io.FileNotFoundException: \tmp\___FX_SCRIPT___.fxdump from StringInputBuffer (Le chemin d'accès spécifié est introuvable)
Exception thrown in JavaFX pretty printing: java.io.FileNotFoundException: \tmp\___FX_SCRIPT___.fxdump from StringInputBuffer (Le chemin d'accès spécifié est introuvable)
17 mai 2008 16:10:03 testfxscript.Main main
GRAVE: null
javax.script.ScriptException: compilation failed
at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.parse(JavaFXScriptEngineImpl.java:227)
at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.eval(JavaFXScriptEngineImpl.java:140)
at com.sun.tools.javafx.script.JavaFXScriptEngineImpl.eval(JavaFXScriptEngineImpl.java:131)
at javax.script.AbstractScriptEngine.eval(Unknown Source)
at testfxscript.Main.main(Main.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:1205)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1151)
at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:998)
at com.sun.javaws.Launcher.run(Launcher.java:105)
at java.lang.Thread.run(Unknown Source)

Any ideas?

Best regards,
Nidaya

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tball
Offline
Joined: 2003-06-10
Points: 0

Bugs and other issues are filed at http://openjfx.java.sun.com/jira/.

nidaya
Offline
Joined: 2006-07-29
Points: 0

Did you find it in the issues list ?

tball
Offline
Joined: 2003-06-10
Points: 0

No, my assumption is that no one has tried the ASCII-script + JNLP combination yet, where there may be security-related issues. In general, when anyone finds a problem, searching the JIRA issue tracking system and filing a bug if nothing is found is the best way to help improve the project.

nidaya
Offline
Joined: 2006-07-29
Points: 0

Thanks, I'll search or create the JIRA issue.