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

[JDT LS] The plain java project is not detected after importing from github #11516

Closed
musienko-maxim opened this issue Oct 5, 2018 · 4 comments
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. sprint/current

Comments

@musienko-maxim
Copy link
Contributor

musienko-maxim commented Oct 5, 2018

Reproduction Steps:

  • Clone plain java project from github: https://github.com/Tarrantella/java-plain-project.git
  • Select in the Project configuration Java. Click Next btn.
    Expected result: The Source Folder should be detected automatically. The project should be detected as Plain java.
    OS and version: OpenShift multiuser, JDT LS assembly, Che 6.12.0 ; Chrome 68; Fedora 28;
    Additional info Probably, this happens because the project does not have .classpath and .project files. But i think after importing this files should generate automatically on client side
    Actual result The src. folder is not detected, the project is not defined as java. In the dev. console errors like:
dev-machine exceptions:
java.lang.IllegalArgumentException: Project for 'file:///projects/java-plain-project' not found
2018-10-05 13:07:49,448[pool-9-thread-1]  [ERROR] [o.e.c.a.l.CheLanguageClient 75]      - Oct 5, 2018 1:07:49 PM Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ls.core".
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:141)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:151)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:433)
Project for 'file:///projects/java-plain-project' not found
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$26(JDTLanguageServer.java:764)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
java.lang.IllegalArgumentException: Project for 'file:///projects/java-plain-project' not found
	at org.eclipse.che.jdt.ls.extension.core.internal.CheDelegateCommandHandler.executeCommand(CheDelegateCommandHandler.java:118)
 
	at org.eclipse.che.jdt.ls.extension.core.internal.CheDelegateCommandHandler.executeCommand(CheDelegateCommandHandler.java:118)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$26(JDTLanguageServer.java:764)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:141)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:433)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	at org.eclipse.che.jdt.ls.extension.core.internal.plain.GetSourceFoldersCommand.execute(GetSourceFoldersCommand.java:47)
	at org.eclipse.che.jdt.ls.extension.core.internal.plain.GetSourceFoldersCommand.execute(GetSourceFoldersCommand.java:47)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
2018-10-05 13:07:49,449[pool-9-thread-1]  [ERROR] [o.e.c.a.l.CheLanguageClient 75]      - Oct 5, 2018 1:07:49 PM Error in calling delegate command handler
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
Project for 'file:///projects/java-plain-project' not found
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
 
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:151)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
Project for 'file:///projects/java-plain-project' not found
2018-10-05 13:07:59,646[pool-9-thread-1]  [ERROR] [o.e.c.a.l.CheLanguageClient 75]      - Oct 5, 2018 1:07:59 PM Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ls.core".
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
	at org.eclipse.che.jdt.ls.extension.core.internal.plain.GetSourceFoldersCommand.execute(GetSourceFoldersCommand.java:47)
	at org.eclipse.che.jdt.ls.extension.core.internal.CheDelegateCommandHandler.executeCommand(CheDelegateCommandHandler.java:118)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:433)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:151)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$26(JDTLanguageServer.java:764)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:141)
 
java.lang.IllegalArgumentException: Project for 'file:///projects/java-plain-project' not found
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:141)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at org.eclipse.che.jdt.ls.extension.core.internal.plain.GetSourceFoldersCommand.execute(GetSourceFoldersCommand.java:47)
Project for 'file:///projects/java-plain-project' not found
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
 
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:151)
	at org.eclipse.che.jdt.ls.extension.core.internal.CheDelegateCommandHandler.executeCommand(CheDelegateCommandHandler.java:118)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$26(JDTLanguageServer.java:764)
java.lang.IllegalArgumentException: Project for 'file:///projects/java-plain-project' not found
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:433)
2018-10-05 13:07:59,647[pool-9-thread-1]  [ERROR] [o.e.c.a.l.CheLanguageClient 75]      - Oct 5, 2018 1:07:59 PM Error in calling delegate command handler
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
Project for 'file:///projects/java-plain-project' not found
	at org.eclipse.che.jdt.ls.extension.core.internal.externallibrary.ProjectExternalLibraryCommand.execute(ProjectExternalLibraryCommand.java:42)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
 
	at org.eclipse.che.jdt.ls.extension.core.internal.CheDelegateCommandHandler.executeCommand(CheDelegateCommandHandler.java:118)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$26(JDTLanguageServer.java:764)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
java.lang.IllegalArgumentException: Project for 'file:///projects/java-plain-project' not found
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
2018-10-05 13:08:03,334[pool-9-thread-1]  [ERROR] [o.e.c.a.l.CheLanguageClient 75]      - Oct 5, 2018 1:08:03 PM Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ls.core".
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:141)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	at org.eclipse.che.jdt.ls.extension.core.internal.externallibrary.LibraryNavigation.getProjectDependencyJars(LibraryNavigation.java:123)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:151)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:433)
Project for 'file:///projects/java-plain-project' not found
java.lang.IllegalArgumentException: Project for 'file:///projects/java-plain-project' not found
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:433)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:141)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
 
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:151)
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
	at org.eclipse.che.jdt.ls.extension.core.internal.externallibrary.ProjectExternalLibraryCommand.execute(ProjectExternalLibraryCommand.java:42)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
2018-10-05 13:08:03,513[pool-9-thread-1]  [ERROR] [o.e.c.a.l.CheLanguageClient 75]      - Oct 5, 2018 1:08:03 PM Error in calling delegate command handler
	at org.eclipse.che.jdt.ls.extension.core.internal.externallibrary.LibraryNavigation.getProjectDependencyJars(LibraryNavigation.java:123)
	at org.eclipse.che.jdt.ls.extension.core.internal.CheDelegateCommandHandler.executeCommand(CheDelegateCommandHandler.java:118)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$26(JDTLanguageServer.java:764)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
2018-10-05 13:09:32,647[pool-9-thread-1]  [INFO ] [j.l.JavaLanguageServerLauncher 96]   - Message: Updating workspace folders: Adding 0 folder(s), removing 1 folders.
2018-10-05 13:09:32,652[kspaceUpdater-0]  [INFO ] [.c.p.j.l.WorkspaceSynchronizer 80]   - Workspace updated. Result code: '0', message: 'OK'. Added projects: '[]', removed projects: '[file:///projects/java-plain-project]'
2018-10-05 13:09:45,352[pool-9-thread-1]  [INFO ] [j.l.JavaLanguageServerLauncher 96]   - Message: Updating workspace folders: Adding 1 folder(s), removing 0 folders.
2018-10-05 13:09:45,368[kspaceUpdater-0]  [INFO ] [.c.p.j.l.WorkspaceSynchronizer 80]   - Workspace updated. Result code: '0', message: 'OK'. Added projects: '[file:///projects/java-plain-project]', removed projects: '[]'
2018-10-05 13:09:45,403[pool-9-thread-1]  [ERROR] [o.e.c.a.l.CheLanguageClient 75]      - Oct 5, 2018 1:09:45 PM Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ls.core".
Project for 'file:///projects/java-plain-project' not found
	at org.eclipse.che.jdt.ls.extension.core.internal.plain.GetSourceFoldersCommand.execute(GetSourceFoldersCommand.java:47)
	at org.eclipse.che.jdt.ls.extension.core.internal.CheDelegateCommandHandler.executeCommand(CheDelegateCommandHandler.java:118)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$26(JDTLanguageServer.java:764)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:151)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
java.lang.IllegalArgumentException: Project for 'file:///projects/java-plain-project' not found
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:141)
2018-10-05 13:09:45,404[pool-9-thread-1]  [ERROR] [o.e.c.a.l.CheLanguageClient 75]      - Oct 5, 2018 1:09:45 PM Error in calling delegate command handler
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:433)
 
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
	at org.eclipse.che.jdt.ls.extension.core.internal.plain.GetSourceFoldersCommand.execute(GetSourceFoldersCommand.java:47)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:151)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
java.lang.IllegalArgumentException: Project for 'file:///projects/java-plain-project' not found
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:433)
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
Project for 'file:///projects/java-plain-project' not found
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:141)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	at org.eclipse.che.jdt.ls.extension.core.internal.CheDelegateCommandHandler.executeCommand(CheDelegateCommandHandler.java:118)
 
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$26(JDTLanguageServer.java:764)
@musienko-maxim musienko-maxim added kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. labels Oct 5, 2018
@tsmaeder
Copy link
Contributor

tsmaeder commented Oct 8, 2018

jdt.ls supports eclipse projects, maven and gradle. Can you fix this with an "update project configuration" and using "simple java" type?

@musienko-maxim
Copy link
Contributor Author

jdt.ls supports eclipse projects, maven and gradle. Can you fix this with an "update project configuration" and using "simple java" type?

I've tried this after updating project configuration as 'simple java' the problem still actual

artaleks9 added a commit that referenced this issue Oct 24, 2018
…11715)

* Add the 'try-catch' to the 'RunPlainJavaProjectTest' according to the known issue #11516
* Add the 'try-catch' to the 'CodeAssistAfterMoveItemTest' according to known issue #11701
* Update the 'MoveItemsTest' related to merge JDT.LS
* Update the 'RenamePackageTest' related to merge JDT.LS
* Add the 'try-catch' to the 'RenamePackageTest' according to the known issue #11713
nickboldt pushed a commit to nickboldt/che that referenced this issue Oct 24, 2018
…clipse-che#11715)

* Add the 'try-catch' to the 'RunPlainJavaProjectTest' according to the known issue eclipse-che#11516
* Add the 'try-catch' to the 'CodeAssistAfterMoveItemTest' according to known issue eclipse-che#11701
* Update the 'MoveItemsTest' related to merge JDT.LS
* Update the 'RenamePackageTest' related to merge JDT.LS
* Add the 'try-catch' to the 'RenamePackageTest' according to the known issue eclipse-che#11713
@tsmaeder
Copy link
Contributor

Ok, problem here is that the problem is initially created as "blank" and then updated to "plain java". We need to generate .classpath and .project files when we detect the type change (if necessary) for jdt.ls to pick up the project as a "Eclipse project".

@artaleks9 artaleks9 added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. and removed status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. labels Jan 19, 2019
@artaleks9
Copy link
Contributor

After merging the PR #12041, the bug is not reproduced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. sprint/current
Projects
None yet
Development

No branches or pull requests

4 participants