redhat-developer / vscode-java

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

!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources". #3306

Open jdneo opened 1 year ago

jdneo commented 1 year ago

!ENTRY org.eclipse.jdt.ls.core 4 0 2023-09-18 15:17:30.277 !MESSAGE Error updating com.microsoft.gradle.bs.importer !STACK 0 java.lang.NullPointerException: Cannot invoke "org.eclipse.m2e.core.internal.MavenPluginActivator.getMavenMarkerManager()" because the return value of "org.eclipse.m2e.core.internal.MavenPluginActivator.getDefault()" is null at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.processBuildResults(MavenBuilderImpl.java:343) at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:194) at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.lambda$0(AbstractLifecycleMapping.java:114) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:394) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:275) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:214) at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:114) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$6(ProjectConfigurationManager.java:504) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:394) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:275) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:498) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$4(ProjectConfigurationManager.java:426) at java.base/java.util.Collection.removeIf(Unknown Source) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration0(ProjectConfigurationManager.java:414) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$3(ProjectConfigurationManager.java:340) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:394) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:275) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:214) at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1097) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:339) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:326) at org.eclipse.jdt.ls.core.internal.managers.MavenBuildSupport.update(MavenBuildSupport.java:86) at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager$3.runInWorkspace(ProjectsManager.java:429) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

!ENTRY org.eclipse.core.resources 4 2 2023-09-18 15:17:30.805 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources". !STACK 0 org.eclipse.core.runtime.InvalidRegistryObjectException: Invalid registry object at org.eclipse.core.internal.registry.RegistryObjectManager.basicGetObject(RegistryObjectManager.java:276) at org.eclipse.core.internal.registry.RegistryObjectManager.getObject(RegistryObjectManager.java:266) at org.eclipse.core.internal.registry.ConfigurationElementHandle.getConfigurationElement(ConfigurationElementHandle.java:29) at org.eclipse.core.internal.registry.ConfigurationElementHandle.getName(ConfigurationElementHandle.java:111) at org.eclipse.jdt.internal.launching.environments.AccessRuleParticipant.getDelegateClassName(AccessRuleParticipant.java:90) at org.eclipse.jdt.internal.launching.environments.AccessRuleParticipant.hashCode(AccessRuleParticipant.java:113) at java.base/java.util.HashMap.hash(Unknown Source) at java.base/java.util.HashMap.put(Unknown Source) at org.eclipse.jdt.internal.launching.environments.ExecutionEnvironment.collectRulesByParticipant(ExecutionEnvironment.java:389) at org.eclipse.jdt.internal.launching.environments.ExecutionEnvironment.getAccessRules(ExecutionEnvironment.java:323) at org.eclipse.jdt.internal.launching.JREContainer.computeClasspathEntries(JREContainer.java:299) at org.eclipse.jdt.internal.launching.JREContainer.getClasspathEntries(JREContainer.java:272) at org.eclipse.jdt.internal.launching.JREContainer.getClasspathEntries(JREContainer.java:390) at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:3278) at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:3436) at org.eclipse.jdt.internal.core.ClasspathChange.generateDelta(ClasspathChange.java:247) at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:2129) at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:501) at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:321) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:311) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:174) at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:458) at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1586) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:50) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

!ENTRY org.eclipse.core.resources 4 2 2023-09-18 15:17:30.913 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources". !STACK 0 org.eclipse.core.runtime.InvalidRegistryObjectException: Invalid registry object at org.eclipse.core.internal.registry.RegistryObjectManager.basicGetObject(RegistryObjectManager.java:276) at org.eclipse.core.internal.registry.RegistryObjectManager.getObject(RegistryObjectManager.java:266) at org.eclipse.core.internal.registry.ConfigurationElementHandle.getConfigurationElement(ConfigurationElementHandle.java:29) at org.eclipse.core.internal.registry.ConfigurationElementHandle.getName(ConfigurationElementHandle.java:111) at org.eclipse.jdt.internal.launching.environments.AccessRuleParticipant.getDelegateClassName(AccessRuleParticipant.java:90) at org.eclipse.jdt.internal.launching.environments.AccessRuleParticipant.hashCode(AccessRuleParticipant.java:113) at java.base/java.util.HashMap.hash(Unknown Source) at java.base/java.util.HashMap.put(Unknown Source) at org.eclipse.jdt.internal.launching.environments.ExecutionEnvironment.collectRulesByParticipant(ExecutionEnvironment.java:389) at org.eclipse.jdt.internal.launching.environments.ExecutionEnvironment.getAccessRules(ExecutionEnvironment.java:323) at org.eclipse.jdt.internal.launching.JREContainer.computeClasspathEntries(JREContainer.java:299) at org.eclipse.jdt.internal.launching.JREContainer.getClasspathEntries(JREContainer.java:272) at org.eclipse.jdt.internal.launching.JREContainer.getClasspathEntries(JREContainer.java:390) at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:3278) at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:3436) at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:2521) at org.eclipse.jdt.internal.core.DeltaProcessingState.getRootInfos(DeltaProcessingState.java:335) at org.eclipse.jdt.internal.core.DeltaProcessingState.initializeRoots(DeltaProcessingState.java:283) at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:2178) at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:501) at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:321) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:311) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:174) at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:444) at org.eclipse.core.internal.events.AutoBuildJob$AutoBuildOffJob.run(AutoBuildJob.java:376) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

NayelliValeria commented 9 months ago

Is there a solution to this issue?

jmakuc commented 8 months ago

Still happening. Mine came when trying to generate unit tests for a class.

Startup logs: !SESSION 2024-02-20 07:46:07.330 ----------------------------------------------- eclipse.buildId=unknown java.version=17.0.8.1 java.vendor=Azul Systems, Inc. BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_CL Framework arguments: --stdio Command-line arguments: -data /Users/jmakuc/Library/Application Support/Code/User/workspaceStorage/402d294c47bb84ebecf513aa8efb347b/redhat.java/jdt_ws --stdio

The exception:

!ENTRY org.eclipse.jdt.ls.core 4 2 2024-02-20 07:47:43.706 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ls.core". !STACK 0 java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.IPackageFragmentRoot.getPackageFragment(String)" because "packageRoot" is null at com.microsoft.java.test.plugin.util.TestGenerationUtils.getTestCompilationUnit(TestGenerationUtils.java:472) at com.microsoft.java.test.plugin.util.TestGenerationUtils.getDefaultTestFullyQualifiedName(TestGenerationUtils.java:416) at com.microsoft.java.test.plugin.util.TestGenerationUtils.getTestFullyQualifiedName(TestGenerationUtils.java:388) at com.microsoft.java.test.plugin.util.TestGenerationUtils.generateTestsFromSource(TestGenerationUtils.java:202) at com.microsoft.java.test.plugin.util.TestGenerationUtils.generateTests(TestGenerationUtils.java:173) at com.microsoft.java.test.plugin.handler.TestDelegateCommandHandler.executeCommand(TestDelegateCommandHandler.java:52) at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:230) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47) at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:220) at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:616) at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87) at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

!ENTRY org.eclipse.jdt.ls.core 4 0 2024-02-20 07:47:43.718 !MESSAGE Error in calling delegate command handler !STACK 0 java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.IPackageFragmentRoot.getPackageFragment(String)" because "packageRoot" is null at com.microsoft.java.test.plugin.util.TestGenerationUtils.getTestCompilationUnit(TestGenerationUtils.java:472) at com.microsoft.java.test.plugin.util.TestGenerationUtils.getDefaultTestFullyQualifiedName(TestGenerationUtils.java:416) at com.microsoft.java.test.plugin.util.TestGenerationUtils.getTestFullyQualifiedName(TestGenerationUtils.java:388) at com.microsoft.java.test.plugin.util.TestGenerationUtils.generateTestsFromSource(TestGenerationUtils.java:202) at com.microsoft.java.test.plugin.util.TestGenerationUtils.generateTests(TestGenerationUtils.java:173) at com.microsoft.java.test.plugin.handler.TestDelegateCommandHandler.executeCommand(TestDelegateCommandHandler.java:52) at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:230) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47) at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:220) at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:616) at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87) at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

jdeflores127 commented 3 months ago

Still happening. Mine came when trying to generate unit tests for a class.

Startup logs: !SESSION 2024-02-20 07:46:07.330 ----------------------------------------------- eclipse.buildId=unknown java.version=17.0.8.1 java.vendor=Azul Systems, Inc. BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_CL Framework arguments: --stdio Command-line arguments: -data /Users/jmakuc/Library/Application Support/Code/User/workspaceStorage/402d294c47bb84ebecf513aa8efb347b/redhat.java/jdt_ws --stdio

The exception:

!ENTRY org.eclipse.jdt.ls.core 4 2 2024-02-20 07:47:43.706 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ls.core". !STACK 0 java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.IPackageFragmentRoot.getPackageFragment(String)" because "packageRoot" is null at com.microsoft.java.test.plugin.util.TestGenerationUtils.getTestCompilationUnit(TestGenerationUtils.java:472) at com.microsoft.java.test.plugin.util.TestGenerationUtils.getDefaultTestFullyQualifiedName(TestGenerationUtils.java:416) at com.microsoft.java.test.plugin.util.TestGenerationUtils.getTestFullyQualifiedName(TestGenerationUtils.java:388) at com.microsoft.java.test.plugin.util.TestGenerationUtils.generateTestsFromSource(TestGenerationUtils.java:202) at com.microsoft.java.test.plugin.util.TestGenerationUtils.generateTests(TestGenerationUtils.java:173) at com.microsoft.java.test.plugin.handler.TestDelegateCommandHandler.executeCommand(TestDelegateCommandHandler.java:52) at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:230) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47) at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:220) at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:616) at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87) at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) !ENTRY org.eclipse.jdt.ls.core 4 0 2024-02-20 07:47:43.718 !MESSAGE Error in calling delegate command handler !STACK 0 java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.IPackageFragmentRoot.getPackageFragment(String)" because "packageRoot" is null at com.microsoft.java.test.plugin.util.TestGenerationUtils.getTestCompilationUnit(TestGenerationUtils.java:472) at com.microsoft.java.test.plugin.util.TestGenerationUtils.getDefaultTestFullyQualifiedName(TestGenerationUtils.java:416) at com.microsoft.java.test.plugin.util.TestGenerationUtils.getTestFullyQualifiedName(TestGenerationUtils.java:388) at com.microsoft.java.test.plugin.util.TestGenerationUtils.generateTestsFromSource(TestGenerationUtils.java:202) at com.microsoft.java.test.plugin.util.TestGenerationUtils.generateTests(TestGenerationUtils.java:173) at com.microsoft.java.test.plugin.handler.TestDelegateCommandHandler.executeCommand(TestDelegateCommandHandler.java:52) at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:230) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47) at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:220) at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:616) at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87) at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

i had the same issue, when i tried create a test class apears the same message. image

This happen because you dont have the folder src/test/java. In my case i forgot add the java subfolder image

When i added the subfolder java i solved this issue and i can use the plugin image