Hi,

you need to do "getSelectedProject(builder)" if you want get the selected project.

On Thu, Dec 25, 2014 at 10:08 AM, <forge-users@lists.jboss.org> wrote:
I can't reproduce the error I had only in eclipse with the methods to create files from templates.

Here is the stacktrace when in the method initializeUI(UIBuilder builder) of the class JbfexMailCommand I use *+project = getSelectedProject(builder.getUIContext());+*

{quote:class=jive_text_macro jive_macro_quote}
java.lang.NullPointerException

    at org.jboss.forge.addon.projects.Projects.getSelectedProject(Projects.java:38)

    at org.jboss.forge.addon.projects.Projects.getSelectedProject(Projects.java:26)

    at org.jboss.forge.addon.projects.ui.AbstractProjectCommand.getSelectedProject(AbstractProjectCommand.java:75)

    at org.jbfex.addon.commands.JbfexMailCommand.initializeUI(JbfexMailCommand.java:77)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:483)

    at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87)

    at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)

    at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103)

    at org.jbfex.addon.commands.JbfexMailCommand_$$_javassist_a82cc850-6130-4c53-b532-5af27d6f1b5a.initializeUI(JbfexMailCommand_$$_javassist_a82cc850-6130-4c53-b532-5af27d6f1b5a.java)

    at org.jboss.forge.addon.ui.impl.controller.SingleCommandControllerImpl.initialize(SingleCommandControllerImpl.java:57)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:483)

    at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$2.call(ClassLoaderAdapterCallback.java:123)

    at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)

    at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.invoke(ClassLoaderAdapterCallback.java:96)

    at org.jboss.forge.addon.ui.controller.CommandController_$$_javassist_ec91fd78-748f-4f17-a5ba-752b5d70413f.initialize(CommandController_$$_javassist_ec91fd78-748f-4f17-a5ba-752b5d70413f.java)

    at org.jboss.tools.forge.ui.internal.ext.dialog.WizardDialogHelper.openWizard(WizardDialogHelper.java:118)

    at org.jboss.tools.forge.ui.internal.ext.dialog.WizardDialogHelper.openWizard(WizardDialogHelper.java:102)

    at org.jboss.tools.forge.ui.internal.ext.dialog.UICommandListDialog$1$1.handleElementSelected(UICommandListDialog.java:233)

    at org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents.handleSelection(QuickAccessContents.java:322)

    at org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents.access$0(QuickAccessContents.java:312)

    at org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents$6.mouseUp(QuickAccessContents.java:461)

    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)

    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4454)

    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)

    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3799)

    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3409)

    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)

    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)

    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)

    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)

    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)

    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)

    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)

    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)

    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)

    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)

    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:483)

    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)

    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)

    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)

    at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

{quote}

Posted by forums
Original post: https://developer.jboss.org/message/914532#914532

_______________________________________________
forge-users mailing list
forge-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-users



--
Daniel Cunha (soro)