This discussion is archived
0 Replies Latest reply: Apr 25, 2012 5:42 AM by 913541 RSS

Can't run JavaFX as JWS

913541 Newbie
Currently Being Moderated
Hi, all.


Recently, I could not run my javafx application as JWS
which has Chart like this.
Stage {
    title: "Application title"
    scene: Scene {
        width: 250
        height:250
        content: [
            BarChart{
                layoutInfo: LayoutInfo{width: 230, height: 200}
                categoryAxis: CategoryAxis{categories: ["cate1", "cate2"]}
                valueAxis: NumberAxis{label: "valueAxis" lowerBound:0 upperBound:15}
                data: BarChart.Series{
                    name: "series"
                    data: [
                        BarChart.Data{value: 10, category: "cate1"},
                        BarChart.Data{value:  5, category: "cate2"}
                    ]}
            }
        ]
    }
}
Following error occurred.


java.lang.NoClassDefFoundError: javafx/scene/chart/BarChart
     at barcharttest.Main.javafx$run$(Main.fx:21)
Caused by: java.lang.ClassNotFoundException: javafx.scene.chart.BarChart
     at java.net.URLClassLoader$1.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(Unknown Source)
     at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at barcharttest.Main.javafx$run$(Main.fx:21)
     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.javafx.runtime.provider.GUIRuntimeProvider$1.run(Unknown Source)
     at com.sun.javafx.tk.swing.SwingToolkit$StartupRoutine.run(Unknown Source)
     at java.awt.event.InvocationEvent.dispatch(Unknown Source)
     at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
     at java.awt.EventQueue.access$000(Unknown Source)
     at java.awt.EventQueue$1.run(Unknown Source)
     at java.awt.EventQueue$1.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
     at java.awt.EventQueue.dispatchEvent(Unknown Source)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
     at java.awt.EventDispatchThread.run(Unknown Source)


My handling is this.

1. build this code (no error occurred)
2. add '<shortcut online="false"><desktop/></shortcut>' to JNLP.
3. double-click on this JNLP and run this application (I can run it and no error occurred)
and exit(shortcut is created on desktop ).
4. double-click shortcut (error occerred).

(Java6 u30)


I think I could execute it a few months ago.
Can anyone suggest a solution to this ?

Thanks in advance.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points