redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.08k stars 438 forks source link

Invalid project description #574

Open mojo2012 opened 6 years ago

mojo2012 commented 6 years ago

When I open the first class in my SAP Hybris workspace the language server starts up and then after some time outputs the following log:

[Error - 07:25:19] 26.06.2018 07:24:41 Initialization failed 
org.eclipse.core.internal.resources.ResourceException: Invalid project description.
java.lang.RuntimeException: org.eclipse.core.internal.resources.ResourceException: Invalid project description.
    at org.eclipse.jdt.ls.core.internal.managers.EclipseProjectImporter.importDir(EclipseProjectImporter.java:96)
    at org.eclipse.jdt.ls.core.internal.managers.EclipseProjectImporter.lambda$0(EclipseProjectImporter.java:63)
    at java.util.ArrayList.forEach(ArrayList.java:1249)
    at java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1080)
    at org.eclipse.jdt.ls.core.internal.managers.EclipseProjectImporter.importToWorkspace(EclipseProjectImporter.java:63)
    at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:132)
    at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.access$1(ProjectsManager.java:126)
    at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager$2.run(ProjectsManager.java:120)
    at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:38)
    at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:733)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2289)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2316)
    at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5733)
    at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5690)
    at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:113)
    at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:217)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)
Caused by: org.eclipse.core.internal.resources.ResourceException: Invalid project description.
    at org.eclipse.core.internal.resources.Project.checkDescription(Project.java:170)
    at org.eclipse.core.internal.resources.Project.assertCreateRequirements(Project.java:54)
    at org.eclipse.core.internal.resources.Project.create(Project.java:264)
    at org.eclipse.core.internal.resources.Project.create(Project.java:248)
    at org.eclipse.jdt.ls.core.internal.managers.EclipseProjectImporter.importDir(EclipseProjectImporter.java:92)
    ... 17 more

It would be nice to know which project it is and what caused this

Environment
Steps To Reproduce

See above

[attach a sample project reproducing the error] -> that's exactly the problem!! attach logs

Current Result

Only stacktrace is printed to the console

Expected Result

Output more infos, so that the issue can be fixed.

fbricon commented 6 years ago

Are you trying to open the SAP Hybris sources in vscode or opening a Java project in SAP Hybris?

mojo2012 commented 6 years ago

Sorry for the misunderstanding. I have a huge SAP hybris codebase. Currently I'm still using eclipse for that. I've been trying to switch to vscode for some time now. But I can't get it to build successfully (it's hard in eclipse too!). Some of the hybris extension projects are not well configured (different eclipse project definitions, some have non, etc). Vscode seems to have problems with one extension in particular: webservicescommons. It always complains about not finding it: message: Project 'smartedit' is missing required Java project: 'webservicescommons';code: 964 - although I can see it in the explorer tree.

softwareCobbler commented 2 years ago

I'm trying to load a reasonably sized old Eclipse project that is composed of a root folder and two subprojects, one of which references the other. I am also getting org.eclipse.core.internal.resources.ResourceException: Invalid project description. Put me down as a vote for "surface information indicating specifically what is invalid about the project".

I also get exactly the same error as OP about Project X is missing required Java project Y, and just like OP, it's definitely on disk, just in some way not visible to the plugin. Information about where the plugin is looking would be awesome!