Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

"IllegalArgumentException: Path must include project and resource name" when unloadable .project file is present #1447

Open
apupier opened this issue May 13, 2020 · 4 comments

Comments

@apupier
Copy link
Member

apupier commented May 13, 2020

Java extension is not working when opening some folders (it works for soem others).
For instance when opening the folder examples of https://github.com/apache/camel-k/tree/master/examples

there is this error in output:

[Error - 3:33:47 PM] May 13, 2020 3:33:47 PM An internal error occurred during: "Initialize workspace".
Path must include project and resource name: /examples
java.lang.IllegalArgumentException: Path must include project and resource name: /examples
	at org.eclipse.core.runtime.Assert.isLegal(Assert.java:66)
	at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2122)
	at org.eclipse.core.internal.resources.Container.getFolder(Container.java:205)
	at org.eclipse.jdt.ls.core.internal.managers.StandardProjectsManager.registerWatchers(StandardProjectsManager.java:311)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer$1.run(JDTLanguageServer.java:277)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Environment
  • Operating System: Fedora 31
  • JDK version: Java 8
  • Visual Studio Code version: 1.45.0
  • Java extension version: 0.61.0
Steps To Reproduce
  1. clone locally https://github.com/apache/camel-k/
  2. in VS Code, File -> Open Folder...
  3. select the examples folder inside the cloned repository
  4. Open one of the Java files
    --> stack trace in output log
    --> several errors reported in files

[Please attach a sample project reproducing the error]

full log with trace activated:
https://gist.github.com/apupier/ca016099587a7730745d1841b094f7e6

Current Result
Expected Result
Additional Informations

it was working few weeks/months ago seems not, i tried with VS Code 1.42.1 and extension 0.55.1 and there was already the issue.

@apupier
Copy link
Member Author

apupier commented May 13, 2020

found out that it was because there was already some .project file. (whcih i already deleted withotu keeping them of course sigh)

it would be nice to have an improved errro message in case there is a .project exisitng but the project cannot be loaded.

@pradhyu
Copy link

pradhyu commented Jul 15, 2020

found out that it was because there was already some .project file. (whcih i already deleted withotu keeping them of course sigh)

it would be nice to have an improved errro message in case there is a .project exisitng but the project cannot be loaded.

Thanks man deleting the .project dir made things work for me.

@dgkm
Copy link

dgkm commented May 2, 2022

found out that it was because there was already some .project file. (whcih i already deleted withotu keeping them of course sigh)

it would be nice to have an improved errro message in case there is a .project exisitng but the project cannot be loaded.

The error message is not clear for this problem and it took us almost few months before we could find this issue on github.

@apupier apupier changed the title "IllegalArgumentException: Path must include project and resource name" for some folders "IllegalArgumentException: Path must include project and resource name" when unloadable .project file is present May 2, 2022
@snjeza
Copy link
Contributor

snjeza commented May 2, 2022

Related issue - #2436

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants