<div dir="ltr">Hi,<br><br>you need to do &quot;getSelectedProject(builder)&quot; if you want get the selected project.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 25, 2014 at 10:08 AM,  <span dir="ltr">&lt;<a href="mailto:forge-users@lists.jboss.org" target="_blank">forge-users@lists.jboss.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I can&#39;t reproduce the error I had only in eclipse with the methods to create files from templates.<br>
<br>
Here is the stacktrace when in the method initializeUI(UIBuilder builder) of the class JbfexMailCommand I use *+project = getSelectedProject(builder.getUIContext());+*<br>
<br>
{quote:class=jive_text_macro jive_macro_quote}<br>
java.lang.NullPointerException<br>
<br>
    at org.jboss.forge.addon.projects.Projects.getSelectedProject(Projects.java:38)<br>
<br>
    at org.jboss.forge.addon.projects.Projects.getSelectedProject(Projects.java:26)<br>
<br>
    at org.jboss.forge.addon.projects.ui.AbstractProjectCommand.getSelectedProject(AbstractProjectCommand.java:75)<br>
<br>
    at org.jbfex.addon.commands.JbfexMailCommand.initializeUI(JbfexMailCommand.java:77)<br>
<br>
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
<br>
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)<br>
<br>
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>
<br>
    at java.lang.reflect.Method.invoke(Method.java:483)<br>
<br>
    at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor$1.call(ClassLoaderInterceptor.java:87)<br>
<br>
    at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)<br>
<br>
    at org.jboss.forge.furnace.proxy.ClassLoaderInterceptor.invoke(ClassLoaderInterceptor.java:103)<br>
<br>
    at org.jbfex.addon.commands.JbfexMailCommand_$$_javassist_a82cc850-6130-4c53-b532-5af27d6f1b5a.initializeUI(JbfexMailCommand_$$_javassist_a82cc850-6130-4c53-b532-5af27d6f1b5a.java)<br>
<br>
    at org.jboss.forge.addon.ui.impl.controller.SingleCommandControllerImpl.initialize(SingleCommandControllerImpl.java:57)<br>
<br>
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
<br>
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)<br>
<br>
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>
<br>
    at java.lang.reflect.Method.invoke(Method.java:483)<br>
<br>
    at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback$2.call(ClassLoaderAdapterCallback.java:123)<br>
<br>
    at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)<br>
<br>
    at org.jboss.forge.furnace.proxy.ClassLoaderAdapterCallback.invoke(ClassLoaderAdapterCallback.java:96)<br>
<br>
    at org.jboss.forge.addon.ui.controller.CommandController_$$_javassist_ec91fd78-748f-4f17-a5ba-752b5d70413f.initialize(CommandController_$$_javassist_ec91fd78-748f-4f17-a5ba-752b5d70413f.java)<br>
<br>
    at org.jboss.tools.forge.ui.internal.ext.dialog.WizardDialogHelper.openWizard(WizardDialogHelper.java:118)<br>
<br>
    at org.jboss.tools.forge.ui.internal.ext.dialog.WizardDialogHelper.openWizard(WizardDialogHelper.java:102)<br>
<br>
    at org.jboss.tools.forge.ui.internal.ext.dialog.UICommandListDialog$1$1.handleElementSelected(UICommandListDialog.java:233)<br>
<br>
    at org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents.handleSelection(QuickAccessContents.java:322)<br>
<br>
    at org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents.access$0(QuickAccessContents.java:312)<br>
<br>
    at org.jboss.tools.forge.ui.internal.ext.quickaccess.QuickAccessContents$6.mouseUp(QuickAccessContents.java:461)<br>
<br>
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)<br>
<br>
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)<br>
<br>
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4454)<br>
<br>
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)<br>
<br>
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3799)<br>
<br>
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3409)<br>
<br>
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)<br>
<br>
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)<br>
<br>
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)<br>
<br>
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)<br>
<br>
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)<br>
<br>
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)<br>
<br>
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)<br>
<br>
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)<br>
<br>
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)<br>
<br>
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)<br>
<br>
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)<br>
<br>
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)<br>
<br>
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)<br>
<br>
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)<br>
<br>
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
<br>
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)<br>
<br>
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>
<br>
    at java.lang.reflect.Method.invoke(Method.java:483)<br>
<br>
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)<br>
<br>
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)<br>
<br>
    at org.eclipse.equinox.launcher.Main.run(Main.java:1465)<br>
<br>
    at org.eclipse.equinox.launcher.Main.main(Main.java:1438)<br>
<br>
{quote}<br>
<br>
Posted by forums<br>
Original post: <a href="https://developer.jboss.org/message/914532#914532" target="_blank">https://developer.jboss.org/message/914532#914532</a><br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
forge-users mailing list<br>
<a href="mailto:forge-users@lists.jboss.org">forge-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-users" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-users</a></div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-size:12px;color:rgb(0,0,0)">Daniel Cunha (soro)</span></div></div></div></div></div>
</div>