Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336258

Summary: Adding the RecommenderNature to a new project throws Exception
Product: z_Archived Reporter: Sebastian Proksch <sebastian>
Component: RecommendersAssignee: Marcel Bruch <marcel.bruch>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Sebastian Proksch CLA 2011-02-03 11:37:08 EST
Creating a new java project and trying to add the recommenders nature via context-menu leads to an exception.

Steps to reproduce:

1) create new project
2) open context menu for the project in the package explorer
3) select "Recommenders"->"Add/Remove Recommenders Nature"

Expected behaviour:

The nature should be added to the project and a builder should be installed.

Actual behaviour:

A NullPointerException is thrown.

Build-Date:
current git-version

Stacktrace:

java.lang.ClassNotFoundException: org.eclipse.recommenders.commons.injection.ExtensionFactory:org.eclipse.recommenders.internal.rcp.RecommendersNature
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
	at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:338)
	at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:232)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1197)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:904)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
	at org.eclipse.core.internal.resources.NatureManager.createNature(NatureManager.java:231)
	at org.eclipse.core.internal.resources.NatureManager$1.run(NatureManager.java:142)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.resources.NatureManager.configureNature(NatureManager.java:158)
	at org.eclipse.core.internal.resources.NatureManager.configureNatures(NatureManager.java:203)
	at org.eclipse.core.internal.resources.Project.basicSetDescription(Project.java:105)
	at org.eclipse.core.internal.resources.Project.setDescription(Project.java:1210)
	at org.eclipse.core.internal.resources.Project.setDescription(Project.java:1238)
	at org.eclipse.recommenders.internal.rcp.RecommendersNatureToggleAction.toggleNature(RecommendersNatureToggleAction.java:62)
	at org.eclipse.recommenders.internal.rcp.RecommendersNatureToggleAction.run(RecommendersNatureToggleAction.java:45)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
	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:3776)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1367)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1390)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1187)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3622)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3277)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	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:369)
	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:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Comment 1 Marcel Bruch CLA 2011-02-03 12:36:57 EST
fixed in head. 

please pull changes, rebase, and verify :)

Thanks for reporting,
Marcel
Comment 2 Johannes Lerch CLA 2011-02-04 11:54:05 EST
I have figured out the problem and documented it in the wiki: http://wiki.eclipse.org/Recommenders/ExtensionFactory
You may switch back to the use of ExtensionFactory now. But note the alternative way of configuration you need (mentioned in the wiki page).
Comment 3 Marcel Bruch CLA 2012-02-02 01:41:28 EST
Closing this issue. Please give latest dev build (v0.5) a try:

http://download.eclipse.org/recommenders/updates/dev/e37/
http://download.eclipse.org/recommenders/updates/dev/e42/
Comment 4 Marcel Bruch CLA 2012-02-02 01:41:52 EST
Closing this issue. Please give latest dev build (v0.5) a try:

http://download.eclipse.org/recommenders/updates/dev/e37/
http://download.eclipse.org/recommenders/updates/dev/e42/