vscode-java-dependency icon indicating copy to clipboard operation
vscode-java-dependency copied to clipboard

Java project in subdirectory of workspace

Open lenzls opened this issue 4 years ago • 9 comments

Hello,

I'm in the same situation as https://github.com/microsoft/vscode-java-dependency/issues/493 and would like to understand how things are supposed to be configured.

I'm having a folder structure like

my-project/ (workspace)
 L java-app/
   L pom.xml
 L frontend/
 L some-other-sub-project/
 L my-project.code-workspace

My workspace file looks like

{
	"folders": [
		{
			"path": "."
		}
	],
	"launch": {
		"configurations": [
			{
				"type": "java",
				"name": "Launch My project java app",
				"request": "launch",
				"mainClass": "com.example.javaApp.MainClass"
				"envFile": "${workspaceFolder}/.env",
				"projectName": "java-app",
				"args": "--spring.profiles.active=development"
			}
		],
		"compounds": []
	}
}

But

  • the "Java Projects" section in the explorer is empty
  • when running my launch config I'm getting

    ConfigError: The project 'newstimeline-server' is not a valid java project.

When I change my workspace to

	"folders": [
		{
			"path": "."
		},
                {
			"path": "java-app"
		},
	],

then my project is shown in the "Java Projects" section and I can get the launch config to somehow work. But that seems more like a workaround.

How would the java extension pack expect me to configure this situation?

lenzls avatar Dec 11 '21 10:12 lenzls

the "Java Projects" section in the explorer is empty

Is that literally 'empty', or no projects is listed?

If the pom file is not at the workspace root, you need to open a java file to activate the java extension.

jdneo avatar Dec 12 '21 02:12 jdneo

This is a screenshot with the pom file open. You see that

  • "java projects" does not recognize the project
  • "maven" reports the one correct java project, located in a subdirectory
  • "spring boot dashboard" does not recognize the project

scrot_2021-12-13_21-49-09_screenshot

When I open a .java file, I get syntax highlighting, but I can't jump to the file of the focused symbol or declaration.

lenzls avatar Dec 13 '21 21:12 lenzls

Looks something wrong when importing project. Is it possible to share a sample project for this problem? We can use it to repro and see where's the gap.

If it's not possible, can you check if there is errors in the Java Language Server log? You can open it by trigger the command: Java: Open Java Language Server Log File

jdneo avatar Dec 14 '21 03:12 jdneo

The mystery seems solved.

The language server log indicates that the project scan was aborted due to an access denied exception.

!ENTRY org.eclipse.jdt.ls.core 4 0 2021-12-15 23:49:43.711
!MESSAGE Initialization failed 
!STACK 1
org.eclipse.core.runtime.CoreException: Failed to scan /home/simon/dev/my-project
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scan(BasicFileDetector.java:140)
	at org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.applies(GradleProjectImporter.java:114)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:121)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:108)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:238)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.nio.file.AccessDeniedException: /home/simon/dev/my-project/data/pgdata
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:441)
	at java.base/java.nio.file.Files.newDirectoryStream(Files.java:482)
	at java.base/java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:301)
	at java.base/java.nio.file.FileTreeWalker.next(FileTreeWalker.java:374)
	at java.base/java.nio.file.Files.walkFileTree(Files.java:2845)
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scanDir(BasicFileDetector.java:178)
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scan(BasicFileDetector.java:138)
	... 6 more 

And indeed, without that specific folder, the java project is correctly identified and listed in the project overview.

Notable is, that the folder with the permission problem is no ancestor of the java project. I have such a layout

my-project/ (workspace)
 L java-app/
   L pom.xml
 L frontend/
 L data/
   L pgdata (only a special user can access this folder)
 L some-other-sub-project/
 L my-project.code-workspace

It seems to me, that the scan should rather skip a folder it can't traverse, instead of aborting the operation. Would you agree?

Kind regards and thanks already for the help!

lenzls avatar Dec 15 '21 23:12 lenzls

@lenzls

Thank you for the information. Please correct me if I'm not understanding correctly.

If the workspace contains pgdata, because of the permission issue, the project import will be aborted?

jdneo avatar Dec 16 '21 01:12 jdneo

At least that was what I thought happened.

But now I'm having trouble to get a nice reproduction recipe.

What I did now:

  1. Today, when I started vscode, my java project was gone again.
  2. Then I removed the pgdata folder
  3. Then restarted vscode
  4. After accessing a *.java file, the extension began searching for java projects again and found the correct subdirectory
  5. Then I added the pgdata folder again (To reproduce the scan failure)
  6. The java project was still there
  7. After restarting vscode many times, the java project is still correctly discovered

In a recent language server log we can see that the AccessDeniedException still occurs while scanning, but the subproject is still correctly discovered. Either this is due to some form of caching, or the issue is a little different than I thought.

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:43:27.557
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is stopping:
!SESSION 2021-12-17 19:44:01.694 -----------------------------------------------
eclipse.buildId=unknown
java.version=17.0.1
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -data /home/simon/.config/Code/User/workspaceStorage/6a5cc109aef2d0ea578d62fdf60682ab/redhat.java/jdt_ws

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:03.732
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.063
!MESSAGE Main thread is waiting

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.153
!MESSAGE >> initialize

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.156
!MESSAGE Initializing Java Language Server 1.7.0.202112160206

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.225
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.226
!MESSAGE Non-Static Commands: [java.edit.organizeImports, java.project.refreshDiagnostics, java.project.import, java.navigate.openTypeHierarchy, java.project.removeFromSourcePath, java.project.listSourcePaths, java.project.resolveStackTraceLocation, java.project.getAll, java.project.isTestFile, java.project.getClasspaths, java.navigate.resolveTypeHierarchy, java.edit.stringFormatting, java.project.getSettings, java.project.updateSourceAttachment, java.project.resolveSourceAttachment, java.project.addToSourcePath]

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.227
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.227
!MESSAGE Non-Static Commands: [java.maven.initializeSearcher, java.maven.searchArtifact, java.maven.addDependency, java.maven.controlContext]

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.228
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.228
!MESSAGE Non-Static Commands: [vscode.java.test.findJavaProjects, vscode.java.test.findTestPackagesAndTypes, vscode.java.test.findTestTypesAndMethods, vscode.java.test.resolvePath, vscode.java.test.findTestLocation, vscode.java.test.get.testpath, vscode.java.test.findDirectTestChildrenForClass, vscode.java.test.navigateToTestOrTarget, vscode.java.test.junit.argument, vscode.java.test.generateTests]

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.229
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.229
!MESSAGE Non-Static Commands: [java.project.refreshLib, java.project.list, java.project.generateJar, java.project.getMainClasses, java.getPackageData, java.resolvePath]

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.232
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.233
!MESSAGE Non-Static Commands: [vscode.java.checkProjectSettings, vscode.java.isOnClasspath, vscode.java.fetchUsageData, vscode.java.validateLaunchConfig, vscode.java.resolveInlineVariables, vscode.java.resolveClassFilters, vscode.java.resolveMainMethod, vscode.java.resolveClasspath, vscode.java.resolveBuildFiles, vscode.java.resolveMainClass, vscode.java.updateDebugSettings, vscode.java.resolveSourceUri, vscode.java.fetchPlatformSettings, vscode.java.buildWorkspace, vscode.java.startDebugSession, vscode.java.inferLaunchCommandLength, vscode.java.resolveElementAtSelection, vscode.java.resolveJavaExecutable]

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.233
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.234
!MESSAGE Non-Static Commands: [java.intellicode.completion, java.intellicode.completion.resolve, java.intellicode.enable]

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.234
!MESSAGE Static Commands: [sts.java.addClasspathListener, sts.java.removeClasspathListener]

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.234
!MESSAGE Non-Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.235
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.235
!MESSAGE Non-Static Commands: [sts.java.javadoc]

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.237
!MESSAGE Static Commands: [sts.java.type]

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.237
!MESSAGE Non-Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.238
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.239
!MESSAGE Non-Static Commands: [sts.java.javadocHoverLink]

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.239
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.240
!MESSAGE Non-Static Commands: [sts.java.location]

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.241
!MESSAGE Static Commands: [sts.java.search.packages, sts.java.search.types]

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.241
!MESSAGE Non-Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.245
!MESSAGE Static Commands: [sts.java.hierarchy.supertypes, sts.java.hierarchy.subtypes]

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.245
!MESSAGE Non-Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.246
!MESSAGE Static Commands: []

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.247
!MESSAGE Non-Static Commands: [sts.java.code.completions]

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.260
!MESSAGE Starting org.eclipse.m2e.core

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.261
!MESSAGE Started org.eclipse.m2e.core 1ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.264
!MESSAGE ProjectRegistryRefreshJob finished 2ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.264
!MESSAGE Starting org.eclipse.buildship.core

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.309
!MESSAGE Started org.eclipse.buildship.core 44ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.324
!MESSAGE LoadingGradleVersionJob finished 14ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:04.368
!MESSAGE >> initialized

!ENTRY org.eclipse.jdt.ls.core 4 0 2021-12-17 19:44:05.592
!MESSAGE Initialization failed 
!STACK 1
org.eclipse.core.runtime.CoreException: Failed to scan /home/simon/dev/my-project
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scan(BasicFileDetector.java:140)
	at org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.applies(GradleProjectImporter.java:114)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:121)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:108)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:238)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.nio.file.AccessDeniedException: /home/simon/dev/my-project/data/pgdata
	at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(Unknown Source)
	at java.base/java.nio.file.Files.newDirectoryStream(Unknown Source)
	at java.base/java.nio.file.FileTreeWalker.visit(Unknown Source)
	at java.base/java.nio.file.FileTreeWalker.next(Unknown Source)
	at java.base/java.nio.file.Files.walkFileTree(Unknown Source)
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scanDir(BasicFileDetector.java:178)
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scan(BasicFileDetector.java:138)
	... 6 more
!SUBENTRY 1 org.eclipse.jdt.ls.core 4 0 2021-12-17 19:44:05.594
!MESSAGE Failed to scan /home/simon/dev/my-project
!STACK 0
java.nio.file.AccessDeniedException: /home/simon/dev/my-project/data/pgdata
	at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(Unknown Source)
	at java.base/java.nio.file.Files.newDirectoryStream(Unknown Source)
	at java.base/java.nio.file.FileTreeWalker.visit(Unknown Source)
	at java.base/java.nio.file.FileTreeWalker.next(Unknown Source)
	at java.base/java.nio.file.Files.walkFileTree(Unknown Source)
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scanDir(BasicFileDetector.java:178)
	at org.eclipse.jdt.ls.core.internal.managers.BasicFileDetector.scan(BasicFileDetector.java:138)
	at org.eclipse.jdt.ls.core.internal.managers.GradleProjectImporter.applies(GradleProjectImporter.java:114)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:121)
	at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:108)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:238)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:05.667
!MESSAGE >> initialization job finished

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:05.724
!MESSAGE >> workspace/didChangeConfiguration

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:05.738
!MESSAGE >> build jobs finished

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:05.789
!MESSAGE >> java/buildWorkspace (incremental)

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:05.801
!MESSAGE >> New configuration: {java={home=/home/simon/.sdkman/candidates/java/current, jdt={ls={vmargs=-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -javaagent:"/home/simon/.vscode/extensions/gabrielbb.vscode-lombok-1.0.1/server/lombok.jar"}}, errors={incompleteClasspath={severity=warning}}, configuration={checkProjectSettingsExclusions=true, updateBuildConfiguration=automatic, maven={userSettings=null, globalSettings=null, notCoveredPluginExecutionSeverity=warning}, workspaceCacheLimit=null, runtimes=[{name=JavaSE-16, path=/home/simon/.sdkman/candidates/java/17.0.0-zulu/}]}, trace={server=off}, import={maven={enabled=true}, gradle={enabled=true, wrapper={enabled=true}, version=null, home=null, java={home=null}, offline={enabled=false}, arguments=null, jvmArguments=null, user={home=null}}, exclusions=[**/node_modules/**, **/.metadata/**, **/archetype-resources/**, **/META-INF/maven/**], generatesMetadataFilesAtProjectRoot=false}, maven={downloadSources=false, updateSnapshots=false}, eclipse={downloadSources=false}, referencesCodeLens={enabled=false}, signatureHelp={enabled=false}, implementationsCodeLens={enabled=false}, format={enabled=true, settings={url=null, profile=null}, comments={enabled=true}, onType={enabled=true}, insertSpaces=true, tabSize=4.0}, saveActions={organizeImports=false}, project={referencedLibraries=[lib/**/*.jar], importOnFirstTimeStartup=automatic, importHint=true, resourceFilters=[node_modules, .git], exportJar={targetPath=${workspaceFolder}/${workspaceFolderBasename}.jar}}, contentProvider={preferred=null}, autobuild={enabled=true}, maxConcurrentBuilds=1.0, recommendations={dependency={analytics={show=true}}}, completion={maxResults=0.0, enabled=true, overwrite=true, guessMethodArguments=false, favoriteStaticMembers=[org.junit.Assert.*, org.junit.Assume.*, org.junit.jupiter.api.Assertions.*, org.junit.jupiter.api.Assumptions.*, org.junit.jupiter.api.DynamicContainer.*, org.junit.jupiter.api.DynamicTest.*, org.mockito.Mockito.*, org.mockito.ArgumentMatchers.*, org.mockito.Answers.*], filteredTypes=[java.awt.*, com.sun.*, sun.*, jdk.*, org.graalvm.*, io.micrometer.shaded.*], importOrder=[java, javax, com, org]}, foldingRange={enabled=true}, progressReports={enabled=true}, codeGeneration={hashCodeEquals={useJava7Objects=false, useInstanceof=false}, useBlocks=false, generateComments=false, toString={template=${object.className} [${member.name()}=${member.value}, ${otherMembers}], codeStyle=STRING_CONCATENATION, skipNullValues=false, listArrayContents=true, limitElements=0.0}, insertionLocation=afterCursor}, selectionRange={enabled=true}, showBuildStatusOnStart={enabled=notification}, server={launchMode=Hybrid}, sources={organizeImports={starThreshold=99.0, staticStarThreshold=99.0}}, imports={gradle={wrapper={checksums=[]}}}, templates={fileHeader=[], typeComment=[]}, references={includeAccessors=true, includeDecompiledSources=true}, typeHierarchy={lazyLoad=false}, settings={url=null}, symbols={includeSourceMethodDeclarations=false}, quickfix={showAt=line}, debug={logLevel=warn, settings={showHex=false, showStaticVariables=false, showQualifiedNames=false, showLogicalStructure=true, showToString=true, maxStringLength=0.0, numericPrecision=0.0, hotCodeReplace=manual, enableRunDebugCodeLens=true, forceBuildBeforeLaunch=true, onBuildFailureProceed=false, console=integratedTerminal, exceptionBreakpoint={skipClasses=[]}, stepping={skipClasses=[], skipSynthetics=false, skipStaticInitializers=false, skipConstructors=false}, jdwp={limitOfVariablesPerJdwpRequest=100.0, requestTimeout=3000.0}, vmArgs=}}, silentNotification=false, dependency={showMembers=false, syncWithFolderExplorer=true, autoRefresh=true, refreshDelay=2000.0, packagePresentation=hierarchical}, help={firstView=auto, showReleaseNotes=true}, test={defaultConfig=, config={}}}}

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:05.806
!MESSAGE >> document/didOpen

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:07.830
!MESSAGE >> textDocument/semanticTokens/full

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:07.834
!MESSAGE >> workspace/executeCommand java.intellicode.enable

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:07.845
!MESSAGE >> workspace/executeCommand java.project.getAll

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:07.847
!MESSAGE >> workspace/executeCommand java.project.listSourcePaths

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:07.940
!MESSAGE >> workspace/executeCommand java.resolvePath

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:07.951
!MESSAGE >> workspace/executeCommand java.project.list

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:08.057
!MESSAGE >> workspace/executeCommand vscode.java.test.get.testpath

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:08.082
!MESSAGE >> workspace/executeCommand java.getPackageData

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:08.111
!MESSAGE >> workspace/executeCommand java.getPackageData

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:08.112
!MESSAGE >> workspace/executeCommand java.getPackageData

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:08.113
!MESSAGE >> workspace/executeCommand java.getPackageData

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:08.115
!MESSAGE >> workspace/executeCommand java.getPackageData

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:08.117
!MESSAGE >> workspace/executeCommand java.getPackageData

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:08.118
!MESSAGE >> workspace/executeCommand java.getPackageData

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:08.156
!MESSAGE >> workspace/executeCommand java.getPackageData

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:08.178
!MESSAGE >> workspace/executeCommand java.getPackageData

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:08.280
!MESSAGE Reconciled 1. Took 1 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:08.318
!MESSAGE >> workspace/executeCommand java.getPackageData

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:09.211
!MESSAGE >> registerWatchers'

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:09.216
!MESSAGE >> registerFeature 'workspace/didChangeWatchedFiles'

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:09.218
!MESSAGE >> watchers registered

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:10.262
!MESSAGE >> workspace/executeCommand sts.java.addClasspathListener

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:10.290
!MESSAGE begin problem for /BypassAuthenticationRunner.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:10.291
!MESSAGE 0 problems reported for /BypassAuthenticationRunner.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:10.293
!MESSAGE Validated 1. Took 1558 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2021-12-17 19:44:10.312
!MESSAGE >> workspace/executeCommand sts.java.addClasspathListener

lenzls avatar Dec 17 '21 18:12 lenzls

Yes, I also have the feel that this is because of the cache.

Maybe you can try this:

  • Make sure the workspace contains pgdata project
  • Trigger command Java: Clean Java Language Server Workspace -> restart and delete

If by doing this, the projects are all disappeared again, then we can confirm that the failure of importing pgdata makes the whole import process aborted

jdneo avatar Dec 18 '21 02:12 jdneo

Okay, with Java: Clean Java Language Server Workspace I can now clearly reproduce.

  • If there is a read-protected directory in the workspace tree, the java project is not found.
  • If there is no read-protected directory in the workspace tree, the java project is found.

lenzls avatar Dec 18 '21 19:12 lenzls

Thank you @lenzls for helping! This should be a bug.

jdneo avatar Dec 19 '21 03:12 jdneo