testforstephen / vscode-pde

VSCode extension to support Eclipse PDE
18 stars 4 forks source link

Sudden "Variable references non-existent resource: ${container_loc:/path}" error #55

Open mattdibi opened 1 year ago

mattdibi commented 1 year ago

Hi there,

this is somewhat related to #53. I'm currently using the setup reported in that issue with my target platform set as:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><?pde version="3.8"?><target name="Kura Target Platform Equinox 3.16.0" sequenceNumber="47">
  <locations>
    <location path="${container_loc:/kura/target-definition/common/repository/plugins}" type="Directory"/>
    <location path="${container_loc:/kura/target-definition/equinox_3.16.0/repository/plugins}" type="Directory"/>
    <location path="${container_loc:/kura/target-definition/test-deps/repository/plugins}" type="Directory"/>
  </locations>
</target>

It worked perfectly fine and still is for a couple of machine I have around. On my main workstation it stopped working and the LSP log is now showing the following:

... see full log ``` !SESSION 2023-04-29 12:02:42.989 ----------------------------------------------- eclipse.buildId=unknown java.version=17.0.7 java.vendor=Eclipse Adoptium BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_IT Command-line arguments: -data /Users/mattia.dalben/Library/Application Support/Code/User/workspaceStorage/4eca9c2f36ab02fdd6e7e5b825207236/redhat.java/jdt_ws !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:47.665 !MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.244 !MESSAGE Main thread is waiting !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.276 !MESSAGE >> initialize !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.279 !MESSAGE Initializing Java Language Server 1.23.0.202304270334 !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.733 !MESSAGE Static Commands: [] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.734 !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.reloadBundles, java.project.isTestFile, java.edit.handlePasteEvent, java.project.getClasspaths, java.navigate.resolveTypeHierarchy, java.edit.stringFormatting, java.project.getSettings, java.project.updateSourceAttachment, java.project.resolveWorkspaceSymbol, java.project.upgradeGradle, java.decompile, java.project.createModuleInfo, java.protobuf.generateSources, java.project.resolveSourceAttachment, java.project.addToSourcePath, java.completion.onDidSelect] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.734 !MESSAGE Static Commands: [] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.735 !MESSAGE Non-Static Commands: [java.intellicode.enable] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.735 !MESSAGE Static Commands: [] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.736 !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 2023-04-29 12:02:48.736 !MESSAGE Static Commands: [] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.737 !MESSAGE Non-Static Commands: [java.project.refreshLib, java.project.checkImportStatus, java.project.list, java.project.generateJar, java.project.getMainClasses, java.getPackageData, java.resolvePath] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.737 !MESSAGE Static Commands: [] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.738 !MESSAGE Non-Static Commands: [java.maven.initializeSearcher, java.maven.searchArtifact, java.maven.addDependency, java.maven.controlContext] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.738 !MESSAGE Static Commands: [] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.738 !MESSAGE Non-Static Commands: [java.pde.resolveLaunchArguments, java.pde.reloadTargetPlatform, java.pde.resolveJUnitArguments] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.739 !MESSAGE Static Commands: [] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.739 !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 2023-04-29 12:02:48.744 !MESSAGE Started org.eclipse.m2e.core 0ms !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.746 !MESSAGE ProjectRegistryRefreshJob finished 0ms !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.763 !MESSAGE Started org.eclipse.buildship.core 16ms !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.780 !MESSAGE >> initialized !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:48.866 !MESSAGE RepositoryRegistryUpdateJob finished 99ms !ENTRY org.eclipse.debug.core 4 120 2023-04-29 12:02:49.061 !MESSAGE Variable references non-existent resource : ${container_loc:/kura/target-definition/common/repository/plugins} !ENTRY org.eclipse.debug.core 4 120 2023-04-29 12:02:49.063 !MESSAGE Variable references non-existent resource : ${container_loc:/kura/target-definition/equinox_3.16.0/repository/plugins} !ENTRY org.eclipse.debug.core 4 120 2023-04-29 12:02:49.063 !MESSAGE Variable references non-existent resource : ${container_loc:/kura/target-definition/test-deps/repository/plugins} !ENTRY org.eclipse.pde.core 4 0 2023-04-29 12:02:49.077 !MESSAGE Variable references non-existent resource : ${container_loc:/kura/target-definition/common/repository/plugins} !STACK 1 org.eclipse.core.runtime.CoreException: Variable references non-existent resource : ${container_loc:/kura/target-definition/common/repository/plugins} at org.eclipse.debug.internal.core.variables.ResourceResolver.abort(ResourceResolver.java:111) at org.eclipse.debug.internal.core.variables.ResourceResolver.resolveValue(ResourceResolver.java:57) at org.eclipse.core.internal.variables.DynamicVariable.getValue(DynamicVariable.java:56) at org.eclipse.core.internal.variables.StringSubstitutionEngine.resolve(StringSubstitutionEngine.java:271) at org.eclipse.core.internal.variables.StringSubstitutionEngine.substitute(StringSubstitutionEngine.java:195) at org.eclipse.core.internal.variables.StringSubstitutionEngine.performStringSubstitution(StringSubstitutionEngine.java:91) at org.eclipse.core.internal.variables.StringVariableManager.performStringSubstitution(StringVariableManager.java:547) at org.eclipse.core.internal.variables.StringVariableManager.performStringSubstitution(StringVariableManager.java:347) at org.eclipse.pde.internal.core.target.AbstractBundleContainer.resolveVariables(AbstractBundleContainer.java:80) at org.eclipse.pde.internal.core.target.DirectoryBundleContainer.getDirectory(DirectoryBundleContainer.java:119) at org.eclipse.pde.internal.core.target.DirectoryBundleContainer.getLocation(DirectoryBundleContainer.java:61) at org.eclipse.pde.core.plugin.TargetPlatform.getLocation(TargetPlatform.java:75) at org.eclipse.pde.internal.core.EclipseHomeInitializer.resetEclipseHomeVariable(EclipseHomeInitializer.java:36) at org.eclipse.pde.core.target.LoadTargetDefinitionJob.resetPlatform(LoadTargetDefinitionJob.java:180) at org.eclipse.pde.core.target.LoadTargetDefinitionJob.runInWorkspace(LoadTargetDefinitionJob.java:145) at org.eclipse.jdt.ls.importer.pde.internal.PDEProjectImporter.initializeProjects(PDEProjectImporter.java:101) at org.eclipse.jdt.ls.importer.pde.internal.PDEProjectImporter.importToWorkspace(PDEProjectImporter.java:77) at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:150) at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:112) at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:257) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) !SUBENTRY 1 org.eclipse.debug.core 4 120 2023-04-29 12:02:49.077 !MESSAGE Variable references non-existent resource : ${container_loc:/kura/target-definition/common/repository/plugins} !ENTRY org.eclipse.pde.core 4 0 2023-04-29 12:02:49.083 !MESSAGE The current target platform contains errors, open Window > Preferences > Plug-in Development > Target Platform for details. !STACK 1 org.eclipse.core.runtime.CoreException: Problems occurred while resolving the target contents at org.eclipse.pde.internal.core.PluginModelManager.getExternalBundles(PluginModelManager.java:696) at org.eclipse.pde.internal.core.PluginModelManager.initializeTable(PluginModelManager.java:605) at org.eclipse.pde.internal.core.PluginModelManager.targetReloaded(PluginModelManager.java:541) at org.eclipse.pde.core.target.LoadTargetDefinitionJob.resetPlatform(LoadTargetDefinitionJob.java:184) at org.eclipse.pde.core.target.LoadTargetDefinitionJob.runInWorkspace(LoadTargetDefinitionJob.java:145) at org.eclipse.jdt.ls.importer.pde.internal.PDEProjectImporter.initializeProjects(PDEProjectImporter.java:101) at org.eclipse.jdt.ls.importer.pde.internal.PDEProjectImporter.importToWorkspace(PDEProjectImporter.java:77) at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:150) at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:112) at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:257) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) Contains: Variable references non-existent resource : ${container_loc:/kura/target-definition/common/repository/plugins} Contains: Variable references non-existent resource : ${container_loc:/kura/target-definition/equinox_3.16.0/repository/plugins} Contains: Variable references non-existent resource : ${container_loc:/kura/target-definition/test-deps/repository/plugins} !SUBENTRY 1 org.eclipse.pde.core 4 0 2023-04-29 12:02:49.084 !MESSAGE Problems occurred while resolving the target contents !SUBENTRY 2 org.eclipse.debug.core 4 120 2023-04-29 12:02:49.084 !MESSAGE Variable references non-existent resource : ${container_loc:/kura/target-definition/common/repository/plugins} !SUBENTRY 2 org.eclipse.debug.core 4 120 2023-04-29 12:02:49.084 !MESSAGE Variable references non-existent resource : ${container_loc:/kura/target-definition/equinox_3.16.0/repository/plugins} !SUBENTRY 2 org.eclipse.debug.core 4 120 2023-04-29 12:02:49.084 !MESSAGE Variable references non-existent resource : ${container_loc:/kura/target-definition/test-deps/repository/plugins} !ENTRY org.eclipse.debug.core 4 120 2023-04-29 12:02:49.085 !MESSAGE Variable references non-existent resource : ${container_loc:/kura/target-definition/common/repository/plugins} !ENTRY org.eclipse.debug.core 4 120 2023-04-29 12:02:49.085 !MESSAGE Variable references non-existent resource : ${container_loc:/kura/target-definition/equinox_3.16.0/repository/plugins} !ENTRY org.eclipse.debug.core 4 120 2023-04-29 12:02:49.086 !MESSAGE Variable references non-existent resource : ${container_loc:/kura/target-definition/test-deps/repository/plugins} !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:02:56.587 !MESSAGE Importing Maven project(s) ```

The same codebase on my Ubuntu machine (but the same goes for all the other machines I tested it with) outputs:

... see full log ``` !SESSION 2023-04-29 12:06:40.146 ----------------------------------------------- eclipse.buildId=unknown java.version=17.0.7 java.vendor=Eclipse Adoptium BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=it_IT Command-line arguments: -data /home/mattia/.config/Code/User/workspaceStorage/3143af1170d3b7a9faac60ae5c88de32/redhat.java/jdt_ws !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:42.952 !MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.263 !MESSAGE Main thread is waiting !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.304 !MESSAGE >> initialize !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.306 !MESSAGE Initializing Java Language Server 1.23.0.202304270334 !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.804 !MESSAGE Uninstalled reference:file:/home/mattia/.vscode/extensions/yaozheng.vscode-pde-0.9.0/server/org.eclipse.jdt.junit4.runtime_1.2.0.v20210326-1251.jar !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.810 !MESSAGE Installed reference:file:/home/mattia/.vscode/extensions/vscjava.vscode-java-test-0.38.2/server/org.eclipse.jdt.junit4.runtime_1.3.0.v20220609-1843.jar !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.839 !MESSAGE Uninstalled reference:file:/home/mattia/.vscode/extensions/vscjava.vscode-java-test-0.38.2/server/org.eclipse.jdt.junit4.runtime_1.3.0.v20220609-1843.jar !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.841 !MESSAGE Installed reference:file:/home/mattia/.vscode/extensions/yaozheng.vscode-pde-0.9.0/server/org.eclipse.jdt.junit4.runtime_1.2.0.v20210326-1251.jar !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.842 !MESSAGE Refresh the bundles !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.909 !MESSAGE Finished Refreshing bundles !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.909 !MESSAGE Started reference:file:/home/mattia/.vscode/extensions/yaozheng.vscode-pde-0.9.0/server/org.eclipse.jdt.junit4.runtime_1.2.0.v20210326-1251.jar !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.912 !MESSAGE Static Commands: [] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.912 !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.reloadBundles, java.project.isTestFile, java.edit.handlePasteEvent, java.project.getClasspaths, java.navigate.resolveTypeHierarchy, java.edit.stringFormatting, java.project.getSettings, java.project.updateSourceAttachment, java.project.resolveWorkspaceSymbol, java.project.upgradeGradle, java.decompile, java.project.createModuleInfo, java.protobuf.generateSources, java.project.resolveSourceAttachment, java.project.addToSourcePath, java.completion.onDidSelect] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.912 !MESSAGE Static Commands: [] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.912 !MESSAGE Non-Static Commands: [java.intellicode.enable] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.913 !MESSAGE Static Commands: [] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.913 !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 2023-04-29 12:06:43.913 !MESSAGE Static Commands: [] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.913 !MESSAGE Non-Static Commands: [java.project.refreshLib, java.project.checkImportStatus, java.project.list, java.project.generateJar, java.project.getMainClasses, java.getPackageData, java.resolvePath] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.913 !MESSAGE Static Commands: [] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.913 !MESSAGE Non-Static Commands: [java.maven.initializeSearcher, java.maven.searchArtifact, java.maven.addDependency, java.maven.controlContext] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.913 !MESSAGE Static Commands: [] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.913 !MESSAGE Non-Static Commands: [java.pde.resolveLaunchArguments, java.pde.reloadTargetPlatform, java.pde.resolveJUnitArguments] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.914 !MESSAGE Static Commands: [] !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.914 !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 2023-04-29 12:06:43.917 !MESSAGE Started org.eclipse.m2e.core 0ms !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.918 !MESSAGE ProjectRegistryRefreshJob finished 1ms !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.949 !MESSAGE Started org.eclipse.buildship.core 30ms !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.955 !MESSAGE RepositoryRegistryUpdateJob finished 0ms !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:43.962 !MESSAGE >> initialized !ENTRY org.eclipse.jdt.ls.core 1 0 2023-04-29 12:06:48.915 !MESSAGE Importing Maven project(s) ```

Changing to other variables results in similar behaviour. I tried with ${project_loc} and ${workspace_loc}, everything that works on my other machines (M1 Macs, Ubuntu, Gitpod instances) doesn't work on my workstation (Intel Mac).

It looks like the variable is now set to something different than before (or not set at all) and it is stuck that way.

Possible causes

The only thing I did with my VSCode environment was remote debugging the application with the following launch.json configuration:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "Kura Remote debugger",
            "projectName": "org.eclipse.kura.nm",
            "request": "attach",
            "hostName": "192.168.1.240",
            "port": 8000
        }
    ]
}

could setting the projectName have anything to do with this error?

Things I tried so far

Issues

I cannot revert back to the condition where the container_loc variable was correctly set and I cannot debug the issue effectively.

Any suggestion on how to further debug the problem and/or fixes is greatly appreciated :)