Skip to content

NoSuchMethodError getMavenProjectFacade() (IMavenProjectFacade) #1024

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
fenjen opened this issue Apr 11, 2023 · 6 comments
Closed

NoSuchMethodError getMavenProjectFacade() (IMavenProjectFacade) #1024

fenjen opened this issue Apr 11, 2023 · 6 comments
Labels
for: eclipse something that is specific for Eclipse status: duplicate type: bug

Comments

@fenjen
Copy link

fenjen commented Apr 11, 2023

Describe the bug
When I create a new "Spring Starter Project" in Eclipse, I get the typical Eclipse error popup window (see below):

To Reproduce

  1. File
  2. New Project
  3. Spring Starter Project
  4. Select one or more dependencies: Spring Web

Eclipse shows then a popup window with a title "Problem Occurred", and a message "'Import Getting Started Content' has encountered a problem". Here's the message:

NoSuchMethodError: 'org.eclipse.m2e.core.project.IMavenProjectFacade org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest.getMavenProjectFacade()'
java.lang.reflect.InvocationTargetException

Here's the stacktrace from Eclipse log:

NoSuchMethodError: 'org.eclipse.m2e.core.project.IMavenProjectFacade org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest.getMavenProjectFacade()'
java.lang.reflect.InvocationTargetException
	at org.springframework.ide.eclipse.boot.wizard.importing.MavenStrategy$MavenCodeSetImport.run(MavenStrategy.java:91)
	at org.springframework.ide.eclipse.boot.wizard.NewSpringBootWizardModel.importProject(NewSpringBootWizardModel.java:343)
	at org.springframework.ide.eclipse.boot.wizard.NewSpringBootWizardModel.performFinish(NewSpringBootWizardModel.java:322)
	at org.springframework.ide.eclipse.boot.wizard.NewSpringBootWizard$1.runInWorkspace(NewSpringBootWizard.java:239)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NoSuchMethodError: 'org.eclipse.m2e.core.project.IMavenProjectFacade org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest.getMavenProjectFacade()'
	at org.sonar.ide.eclipse.m2e.SonarProjectConfigurator.configure(SonarProjectConfigurator.java:52)
	at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:123)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$6(ProjectConfigurationManager.java:504)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:394)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:275)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:498)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.configureNewMavenProjects(ProjectConfigurationManager.java:279)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$1(ProjectConfigurationManager.java:166)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:394)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:275)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:214)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.importProjects(ProjectConfigurationManager.java:139)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.importProjects(ProjectConfigurationManager.java:130)
	at org.springframework.ide.eclipse.boot.wizard.importing.MavenStrategy.createEclipseProjectFromExistingMavenProject(MavenStrategy.java:134)
	at org.springframework.ide.eclipse.boot.wizard.importing.MavenStrategy$MavenCodeSetImport.run(MavenStrategy.java:85)
	at org.springframework.ide.eclipse.boot.wizard.NewSpringBootWizardModel.importProject(NewSpringBootWizardModel.java:343)
	at org.springframework.ide.eclipse.boot.wizard.NewSpringBootWizardModel.performFinish(NewSpringBootWizardModel.java:322)
	at org.springframework.ide.eclipse.boot.wizard.NewSpringBootWizard$1.runInWorkspace(NewSpringBootWizard.java:239)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
@martinlippert
Copy link
Member

This line:

Caused by: java.lang.NoSuchMethodError: 'org.eclipse.m2e.core.project.IMavenProjectFacade org.eclipse.m2e.core.project.configurator.ProjectConfigurationRequest.getMavenProjectFacade()'
	at org.sonar.ide.eclipse.m2e.SonarProjectConfigurator.configure(SonarProjectConfigurator.java:52)

looks like you have a lifecycle connector from sonar installed that is not compatible with the version of m2e that you have. Please check with Sonar for a compatible m2e lifecycle connector (or uninstall that connector).

@fenjen
Copy link
Author

fenjen commented Apr 12, 2023

Thank you very much for that. I uninstalled the m2e sonar connector and it works. Isn't it possible to check all required dependencies beforehand? These super frequent nonsensical Eclipse error popups are why everyone is moving away from Eclipse. I really don't know what I did wrong.

Next error: When creating a Spring Starter project in a non-default, custom file system location, then Eclipse / STS stops the setup process before renaming the Project to the specified name and before moving it to the working set. There's no log message in that case. Creating a Spring Starter project in default file system location works as expected, and creating a Java or maven project in non-default locations work as expected, too. Workaround:

  1. Create Spring Starter Project with [x] use default location checked.
  2. Exit Eclipse.
  3. Move project directory to non-default location on command line.
  4. Delete the project in Eclipse and re-import it using Import - "Existing Projects into Workspace".

The original problem is solved, if dependency checks cannot be added. At least, people with the same error message will be able to find an solution now. Thanks! (Google didn't yield any relevant results for "getMavenProjectFacade" "noSuchMethodError".)

@BoykoAlex
Copy link
Contributor

@fenjen If location is specified some place else then the workspace folders the project isn't created? (See below)
Screenshot 2023-04-12 at 09 51 24

Is this correct?

I'm using 4.18.0 and I see that the project is created at the location is specified and imported into the workspace with the specified name it seems... Are you using Windows?

@martinlippert
Copy link
Member

@fenjen and @BoykoAlex, please move the issue around the project location to a new, separate GitHub issue.

@martinlippert
Copy link
Member

Thank you very much for that. I uninstalled the m2e sonar connector and it works. Isn't it possible to check all required dependencies beforehand? These super frequent nonsensical Eclipse error popups are why everyone is moving away from Eclipse. I really don't know what I did wrong.

I don't think you did anything wrong here and I agree that errors like this can be very frustrating, no question about that. Since Eclipse allows you to install (more or less random) extensions, there is not a lot that we can do here beyond relying on the general install/update mechanism and the metadata the plugin authors define on their extensions. The plugin authors should try to either provide always up-to-date versions of their extensions that work fine with the latest Eclipse and m2e versions - or add version constraints, so that the install or update process can verify those dependencies (as you suggested). This verification happens, but it needs the corresponding data to operate on.

The original problem is solved, if dependency checks cannot be added. At least, people with the same error message will be able to find an solution now. Thanks! (Google didn't yield any relevant results for "getMavenProjectFacade" "noSuchMethodError".)

At least the authors of the Sonar plugin should provide a fixed version of their extension that is compatible with the latest m2e versions. That would solve the underlying problem, so probably worth reporting this issue to them as well.

Since I also suggested to move the investigation around the project location problem to a separate issue, I will close this one here for now.

@fenjen
Copy link
Author

fenjen commented Apr 12, 2023

@martinlippert Yes, thank you very much!
@BoykoAlex Yes, I'm on Windows. I created a new issue: #1025.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
for: eclipse something that is specific for Eclipse status: duplicate type: bug
Projects
None yet
Development

No branches or pull requests

3 participants