Closed H-Lo closed 2 years ago
I tried your pom.xm
and the general Maven -> Update Project
functionality in a vanilla Spring Tools 4.16.0 for Eclipse distribution build and that seems to work, so we need to find out why this isn't working on your end and what triggers that.
Can you share your SpringToolSuite4.ini
file? The project definition uses Lombok, so please check whether you have the Lombok extension installed and configured. The Lombok extension integrates and modifies the internals of the Java tooling in Eclipse, so that can cause issues like this if the version is not 100% compatible with the Eclipse JDT version that is used in the IDE. The Lombok extension is just guesswork here, but let's see.
STS locations E:\app\sts-4.15.3.RELEASE E:\app\sts-4.16.0.RELEASE
Symbolic link makes easy to upgrade without changing paths all around:
E:\app\> mklink /D sts sts-4.15.3.RELEASE
In the start menu there is a shortcut to E:\app\sts\SpringToolSuite4.exe
,
not to E:\app\sts-4.16.0.RELEASE\SpringToolSuite4.exe
but it works like a charm for years.
Lombok (both instances ver 1.18.24) lombok.jar (1,972,167 bytes)
SpringToolSuite4.ini
The only manual change is -Xms and -Xmx and there is also a change made by Lombok
4.15.3
-startup
plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.500.v20220509-0833
-product
org.springframework.boot.ide.branding.sts4
--launcher.defaultAction
openFile
-vm
plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.4.v20220805-1047/jre/bin
-vmargs
--add-opens=java.base/java.io=ALL-UNNAMED
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
--add-opens=java.base/java.net=ALL-UNNAMED
--add-opens=java.base/sun.security.ssl=ALL-UNNAMED
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms2048m
-Xmx16384m
--illegal-access=deny
--add-modules=ALL-SYSTEM
-javaagent:E:\app\sts\lombok.jar
4.16.0
-startup
plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.2.600.v20220720-1916
-product
org.springframework.boot.ide.branding.sts4
--launcher.defaultAction
openFile
-vm
plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.4.v20220903-1038/jre/bin
-vmargs
--add-opens=java.base/java.io=ALL-UNNAMED
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
--add-opens=java.base/java.net=ALL-UNNAMED
--add-opens=java.base/sun.security.ssl=ALL-UNNAMED
-Dosgi.requiredJavaVersion=11
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms2048m
-Xmx16384m
--illegal-access=deny
--add-modules=ALL-SYSTEM
-javaagent:E:\app\sts\lombok.jar
If needed I can provide a session through TeamViewer or AnyDesk and let you explore Eclipse instance and project setup.
Oh yes, and Eclipse error log:
!ENTRY org.eclipse.ui 2 2 2022-09-17 00:20:08.770
!MESSAGE Invalid property category path: org.springframework.ide.eclipse.beans.ui.properties.ProjectPropertyPage (bundle: org.springframework.ide.eclipse.xml.namespaces, propertyPage: org.springframework.ide.eclipse.beans.ui.namespaces.projectPropertyPage)
!SESSION 2022-09-17 00:20:10.840 -----------------------------------------------
eclipse.buildId=4.16.0.202209151144
java.version=17.0.4.1
java.vendor=Eclipse Adoptium
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.springframework.boot.ide.branding.sts4
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.springframework.boot.ide.branding.sts4
!ENTRY org.eclipse.jface 2 0 2022-09-17 00:20:15.104
!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation.
!SUBENTRY 1 org.eclipse.jface 2 0 2022-09-17 00:20:15.104
!MESSAGE A conflict occurred for CTRL+SHIFT+T:
Binding(CTRL+SHIFT+T,
ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type,
Open a type in a Java editor,
Category(org.eclipse.ui.category.navigate,Navigate,null,true),
WorkbenchHandlerServiceHandler("org.eclipse.jdt.ui.navigate.open.type"),
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+SHIFT+T,
ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace,
,
Category(org.eclipse.lsp4e.category,Language Servers,null,true),
WorkbenchHandlerServiceHandler("org.eclipse.lsp4e.symbolinworkspace"),
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2022-09-17 00:20:15.104
!MESSAGE A conflict occurred for ALT+SHIFT+R:
Binding(ALT+SHIFT+R,
ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring ,
Rename the selected element,
Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true),
WorkbenchHandlerServiceHandler("org.eclipse.jdt.ui.edit.text.java.rename.element"),
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(ALT+SHIFT+R,
ParameterizedCommand(Command(org.eclipse.ui.edit.rename,Rename,
Rename the selected item,
Category(org.eclipse.ui.category.file,File,null,true),
WorkbenchHandlerServiceHandler("org.eclipse.ui.edit.rename"),
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
!ENTRY org.eclipse.egit.ui 2 0 2022-09-17 00:20:20.480
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\Hrvoje'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.
!ENTRY org.eclipse.m2e.logback.appender 4 0 2022-09-17 00:20:23.931
!MESSAGE Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.JavaProject.loadModulesInJimage(JavaProject.java:983)
at org.eclipse.jdt.internal.core.JavaProject.computePackageFragmentRoots(JavaProject.java:782)
at org.eclipse.jdt.internal.core.JavaProject.computePackageFragmentRoots(JavaProject.java:1103)
at org.eclipse.jdt.internal.core.JavaProject.computePackageFragmentRoots(JavaProject.java:1048)
at org.eclipse.jdt.internal.core.JavaProject.computePackageFragmentRoots(JavaProject.java:1025)
at org.eclipse.jdt.internal.core.JavaProject.buildStructure(JavaProject.java:538)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:266)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:597)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:328)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:314)
at org.eclipse.jdt.internal.core.JavaProject.getModuleDescription(JavaProject.java:3917)
at org.eclipse.m2e.jdt.internal.ModuleSupport.getModuleInfo(ModuleSupport.java:214)
at org.eclipse.m2e.jdt.internal.ModuleSupport.configureClasspath(ModuleSupport.java:123)
at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.configureClasspath(AbstractJavaProjectConfigurator.java:1012)
at org.eclipse.m2e.jdt.internal.DefaultClasspathManagerDelegate.populateClasspath(DefaultClasspathManagerDelegate.java:68)
at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:242)
at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:363)
at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:345)
at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:371)
at org.eclipse.m2e.jdt.internal.BuildPathManager.updateClasspath(BuildPathManager.java:202)
at org.eclipse.m2e.jdt.internal.BuildPathManager.mavenProjectChanged(BuildPathManager.java:190)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:827)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:982)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.lambda$0(ProjectRegistryRefreshJob.java:170)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:350)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:262)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:205)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryRefreshJob.run(ProjectRegistryRefreshJob.java:104)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
!ENTRY org.eclipse.ui 2 2 2022-09-17 00:20:26.584
!MESSAGE Invalid property category path: org.springframework.ide.eclipse.beans.ui.properties.ProjectPropertyPage (bundle: org.springframework.ide.eclipse.xml.namespaces, propertyPage: org.springframework.ide.eclipse.beans.ui.namespaces.projectPropertyPage)
!ENTRY org.eclipse.core.jobs 4 2 2022-09-17 00:20:33.034
!MESSAGE An internal error occurred during: "Updating Maven Project".
!STACK 0
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
at org.eclipse.jdt.internal.compiler.util.JRTUtil.walkModuleImage(JRTUtil.java:242)
at org.eclipse.jdt.internal.core.JavaProject.loadModulesInJimage(JavaProject.java:983)
at org.eclipse.jdt.internal.core.JavaProject.computePackageFragmentRoots(JavaProject.java:782)
at org.eclipse.jdt.internal.core.JavaProject.computePackageFragmentRoots(JavaProject.java:1103)
at org.eclipse.jdt.internal.core.JavaProject.computePackageFragmentRoots(JavaProject.java:1048)
at org.eclipse.jdt.internal.core.JavaProject.computePackageFragmentRoots(JavaProject.java:1025)
at org.eclipse.jdt.internal.core.JavaProject.buildStructure(JavaProject.java:538)
at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:266)
at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:597)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:328)
at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:314)
at org.eclipse.jdt.internal.core.JavaProject.getModuleDescription(JavaProject.java:3917)
at org.eclipse.m2e.jdt.internal.ModuleSupport.getModuleInfo(ModuleSupport.java:214)
at org.eclipse.m2e.jdt.internal.ModuleSupport.configureClasspath(ModuleSupport.java:123)
at org.eclipse.m2e.jdt.internal.AbstractJavaProjectConfigurator.configureClasspath(AbstractJavaProjectConfigurator.java:1012)
at org.eclipse.m2e.jdt.internal.DefaultClasspathManagerDelegate.populateClasspath(DefaultClasspathManagerDelegate.java:68)
at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:242)
at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:363)
at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:345)
at org.eclipse.m2e.jdt.internal.BuildPathManager.getClasspath(BuildPathManager.java:371)
at org.eclipse.m2e.jdt.internal.BuildPathManager.updateClasspath(BuildPathManager.java:202)
at org.eclipse.m2e.jdt.internal.BuildPathManager.mavenProjectChanged(BuildPathManager.java:190)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:827)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:982)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:323)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration0(ProjectConfigurationManager.java:386)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$3(ProjectConfigurationManager.java:339)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:350)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:262)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:205)
at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1093)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:338)
at org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob.runInWorkspace(UpdateMavenProjectJob.java:80)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
@H-Lo Since we guess that the Lombok extension might be involved in this, it would be great if you could try a vanilla Spring Tools 4.16.0 for Eclipse installation a try with the same project and run the Maven -> Update Project
command to see if the same exception occurs or not. Can you try that?
@martinlippert Ok, just tried that a minute ago - unpacked Eclipse STS 4.16.0 and opened my workspace without any plugin installation. That means no Lombok, none items installed from Eclipse Marketplace, no any other plugin at all. And still I'm getting this:
An internal error occurred during: "Updating Maven Project".
Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
@martinlippert I can also try to create new workspace and import my project into this clean workspace if you think it could help.
@H-Lo Thanks for trying this, so it looks like the Lombok extension might indeed not be involved here. Do you have a small sample project that you could share with us that reproduces this issue from a plain STS 4.16.0 installation?
@martinlippert Sorry! Just deleted my previous comment because it was 4.15.3 that was running. If you did catch this comment, please ignore it. I'll be back in 20 minutes when I try small project with 4.16.0
@martinlippert Ok, here we have small project that I created to test something with Spring Cache. This project can be Maven Updated with 4.15.3 and cannot be updated with 4.16.0 no matter is it clean install or full installation with Lombok and my favourite plugins.
If you're interested and have ideas where to check, we can try with TeamViewer or AnyDesk session.
Tried your sample project, the usual "it works on my machine"... ;-) The next thing that comes to my mind is to check the JREs that you have configured in your IDE...
@martinlippert Here they are:
@martinlippert Good news! The workspace is the one who does this! Now I created new workspace with STS 4.16.0, Lombok and all other plugins. Then imported my project and waited for automatic build to finish. Then tried Update Maven Project and it works. Don't know why is that becuause when I switch to 4.15.3 old workspace works without errros.
@martinlippert Please check your email. This buggy workspace is available for download from my Dropbox if needed for analysis.
@martinlippert Ok, more news, don't know good or bad. New workspace has been using Java from Eclipse STS installation
E:\app\sts-4.16.0.RELEASE\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.4.v20220903-1038\jre
and everything was working fine.
Then I added JRE using Preferences -> Installed JREs and when I set this one as default, that's the moment when things stop working.
Switching back to Java bundled with Eclipse STS, it works again.
Looks like the JRE you are adding to the preferences is somehow not compatible or not working as expected from the tooling perspective. In case you can provide clear steps how to reproduce this (e.g. which JRE is causing the issue and where to get it from, where is needs to be installed in order to cause the issue, etc.), it might be worth filing an issue with the JDT project in order to get their feedback on this.
For now, I will close the issue here, since you found the underlying problem with the installed JRE and it doesn't seem to be related to the Spring Tools part of your IDE, so closing this here seems like a good choice to me.
Thanks again for reporting this and for trying all the various things that we suggested here. Much appreciated!!!
As a beginner, I didn't got too much but I am facing the same problem. I have STS 4.16.0 but when I have installed the jacoco and restarted the STS. It didn't shows the the junit option in the coverage as option. Instead of that, It only shows the coverage configurations
@kapil1504 The problems that you describe sound somewhat unrelated to the overall topic of this issue here. In addition to that the version that you refer in your comment is somewhat outdated, so I would recommend to try this with the latest version of the Spring Tools for Eclipse (4.19.0 at the moment).
In addition to that, if a problem appears after adding another third-party extension here (you mentioned jacoco), it might be worth trying this third-party extension with a vanilla Eclipse installation to see if that works in general in the way you expect an if not, report it to the maintainers of that third-party extension.
Describe the bug Update Maven Project is not working in 4.16.0.
To Reproduce Update Eclipse STS from 4.15.3 to 4.16.0 and run update maven project.
Sample An internal error occurred during: "Updating Maven Project". Cannot invoke "org.eclipse.jdt.internal.compiler.util.JrtFileSystem.walkModuleImage(org.eclipse.jdt.internal.compiler.util.JRTUtil$JrtFileVisitor, int)" because the return value of "org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(java.io.File, String)" is null
CONFIGURATION
Windows 11 Pro - 21H2 - 22000.978 - Windows Feature Experience Pack 1000.22000.978.0
c:>java -version java version "17" 2021-09-14 LTS Java(TM) SE Runtime Environment (build 17+35-LTS-2724) Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)
Eclipse STS Version 4.16.0.RELEASE Build Id: 202209151144
Eclipse installed software
pom.xml