Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] ClassCastException when updating project configuration

Please submit new bugreport in m2e bugzilla [1] and provide sample project steps we need to use to reproduce the problem

[1] https://bugs.eclipse.org/bugs/enter_bug.cgi?product=m2e

--
Regards,
Igor

On 11-05-09 08:49 AM, Kristoffer Peterhaensel wrote:
Hey.

Wasn't quite sure how you want to handle bugs in the 0.13 builds of m2e.
But it seems the latest milestone and nightly both have a problem that
results in a silent error when I am trying to update my project
configuration. In the Eclipse Error Log this can been seen:

java.lang.ClassCastException: org.eclipse.core.internal.resources.Folder
cannot be cast to org.eclipse.core.resources.IProject
at
org.eclipse.m2e.core.ui.internal.dialogs.UpdateDepenciesDialog.getMavenCodebases(UpdateDepenciesDialog.java:327)

at
org.eclipse.m2e.core.ui.internal.dialogs.UpdateDepenciesDialog.createDialogArea(UpdateDepenciesDialog.java:192)

at
org.eclipse.jface.dialogs.TitleAreaDialog.createContents(TitleAreaDialog.java:155)

at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
at org.eclipse.jface.window.Window.open(Window.java:790)
at
org.eclipse.m2e.core.ui.internal.actions.UpdateConfigurationAction.run(UpdateConfigurationAction.java:30)

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.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
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:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
at org.eclipse.equinox.launcher.Main.main(Main.java:1384)

I *think* the problem is exactly what it says in the JavaDoc for
IWorkspaceRoot#getContainerForLocation:
"Warning: This method ignores linked resources and their children. Since
linked resources may overlap other resources, a unique mapping from a
file system location to a single resource is not guaranteed. To find all
resources for a given location, including linked resources, use the
method findContainersForLocation."

And I have a couple of multi-module projects where each child module is
imported as a separate project. So it is likely ending up with the
folder that is inside the main project instead of the project one.

/Kristoffer Peterhänsel



Back to the top