Issue Details (XML | Word | Printable)

Key: FXP-55
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Bratukhin, Andrey
Reporter: Hedefalk, Viktor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JavaFX plug-in

Run as JavaFX Application results in Nullpointer

Created: 22/Apr/10 01:45 PM   Updated: 18/May/10 07:02 PM   Resolved: 18/May/10 06:58 PM
Component/s: Launcher
Affects Version/s: 1.2.4
Fix Version/s: 1.3.1

Time Tracking:
Not Specified

Environment: osx eclipse 3.5.2 m2eclipse Exadel JavaFX Plug-in 1.2.4.N13


 Description  « Hide
I'm trying to run a JavaFX script file with a Stage in my mavenized project. I get

java.lang.NullPointerException
at com.exadel.javafx.ide.internal.launching.JFXAppLaunchConfigDelegate.launch(JFXAppLaunchConfigDelegate.java:105)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
at com.exadel.javafx.ide.internal.ui.launching.JFXLaunchShortcut.launch(JFXLaunchShortcut.java:219)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:424)
at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.run(LaunchShortcutAction.java:70)
at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.runWithEvent(LaunchShortcutAction.java:121)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1273)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3441)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3100)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)


Hedefalk, Viktor added a comment - 22/Apr/10 01:57 PM
When I look at the created run configuration I see the warning:
Can't find Main stage

My Stage is in Main.fx in package se.apogo.xxx

but the Stage-field in the run-config is only "Main", shouldn't it be the fully qualified name?

Even though I fix this to the qualified name, the warning remains.

I can also note that my javafx-project doesn't appear if I try to manually create the run configuration.


For the record, I can build my project with Maven and the FEST JavaFX maven plugin to a jar and run javafx -jar myproject.jar just fine.

Hedefalk, Viktor added a comment - 22/Apr/10 02:01 PM
Okej, If I added javanature to the project, it appeared in the run config dialog. Now I can also find the run as JavaFX Application from the context menu by right-clicking the project in the package explorer for example.

Do it need to have Java-nature?

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>xxx</name>
<comment></comment>
<projects>
<project>thermometer-model</project>
</projects>
<buildSpec>
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
<buildCommand>
<name>com.exadel.javafx.ide.core.builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>com.exadel.javafx.ide.core.nature</nature>
</natures>
</projectDescription>

Hedefalk, Viktor added a comment - 22/Apr/10 02:04 PM
If I launch as Applet I get a similar stacktrace:

java.lang.NullPointerException
at com.exadel.javafx.ide.internal.ui.launching.JFXLaunchAppletShortcut.launch(JFXLaunchAppletShortcut.java:103)
at com.exadel.javafx.ide.internal.ui.launching.JFXLaunchAppletShortcut.launch(JFXLaunchAppletShortcut.java:84)
at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(LaunchShortcutExtension.java:424)
at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.run(LaunchShortcutAction.java:70)
at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.runWithEvent(LaunchShortcutAction.java:121)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1273)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3441)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3100)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)

Sorry about the spamming but I just want to give as much info as possible. I would really love a working setup of maven/javafx/eclipse :)

Hedefalk, Viktor added a comment - 22/Apr/10 02:07 PM
For some reason it just started working. Seems like it just didn't build before. I guess the nullpointers simply reflected that there were no .class files?

Hedefalk, Viktor added a comment - 22/Apr/10 02:09 PM
Okej, I need javanature, but not the javabuilder. Might be good to know.

Hudson system user added a comment - 18/May/10 07:02 PM
Integrated in exadel-javafx-plugin-continuous #59 (See [http://hudson.exadel.org/hudson/job/exadel-javafx-plugin-continuous/59/])
    FXP-55 - Algorithm of detecting JavaFX project was fixed.