spring-attic / spring-ide

Spring Development Environment for Eclipse
300 stars 126 forks source link

@RequestMappings view in Spring Tool Suite 3.9.x doesn't populate since upgrading project to Spring Boot 2.2.x #398

Closed lordofthemoon closed 4 years ago

lordofthemoon commented 4 years ago

We use Spring Tool Suite 3.9.4 and since upgrading one of our Spring Boot projects from 2.1.9 to 2.2.1, STS's "@RequestMappings" view no longer populates. The error log records the following stack trace:

org.springframework.core.annotation.AnnotationConfigurationException: Attribute 'proxyBeanMethods' in annotation [org.springframework.boot.SpringBootConfiguration] is declared as an @AliasFor nonexistent attribute 'proxyBeanMethods' in annotation [org.springframework.context.annotation.Configuration].; nested exception is java.lang.NoSuchMethodException: org.springframework.context.annotation.Configuration.proxyBeanMethods()
    at org.springframework.core.annotation.AnnotationUtils$AliasDescriptor.<init>(AnnotationUtils.java:2089)
    at org.springframework.core.annotation.AnnotationUtils$AliasDescriptor.from(AnnotationUtils.java:2056)
    at org.springframework.core.annotation.AnnotationUtils.getAttributeAliasNames(AnnotationUtils.java:1726)
    at org.springframework.core.annotation.AnnotationUtils.isSynthesizable(AnnotationUtils.java:1685)
    at org.springframework.core.annotation.AnnotationUtils.synthesizeAnnotation(AnnotationUtils.java:1468)
    at org.springframework.core.annotation.AnnotationUtils.synthesizeAnnotationArray(AnnotationUtils.java:1572)
    at org.springframework.core.annotation.AnnotationUtils.getAnnotations(AnnotationUtils.java:231)
    at org.springframework.core.type.classreading.AnnotationAttributesReadingVisitor.visitEnd(AnnotationAttributesReadingVisitor.java:76)
    at org.springframework.asm.ClassReader.readAnnotationValues(ClassReader.java:2020)
    at org.springframework.asm.ClassReader.accept(ClassReader.java:676)
    at org.springframework.asm.ClassReader.accept(ClassReader.java:527)
    at org.springframework.ide.eclipse.core.java.classreading.JdtConnectedMetadataReader.<init>(JdtConnectedMetadataReader.java:45)
    at org.springframework.ide.eclipse.core.java.classreading.JdtMetadataReaderFactory.getMetadataReader(JdtMetadataReaderFactory.java:53)
    at org.springframework.ide.eclipse.core.java.classreading.CachingJdtMetadataReaderFactory.getMetadataReader(CachingJdtMetadataReaderFactory.java:38)
    at org.springframework.ide.eclipse.beans.core.internal.model.BeansJavaConfig.registerBean(BeansJavaConfig.java:368)
    at org.springframework.ide.eclipse.beans.core.internal.model.BeansJavaConfig$2.call(BeansJavaConfig.java:229)
    at org.springframework.ide.eclipse.beans.core.internal.model.BeansJavaConfig$2.call(BeansJavaConfig.java:1)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodException: org.springframework.context.annotation.Configuration.proxyBeanMethods()
    at java.lang.Class.getDeclaredMethod(Class.java:2130)
    at org.springframework.core.annotation.AnnotationUtils$AliasDescriptor.<init>(AnnotationUtils.java:2082)
    ... 22 more

with session data:

eclipse.buildId=3.9.4.201804120943-RELEASE-e46
java.version=1.8.0_91
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Framework arguments:  -product org.springsource.sts.ide
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.springsource.sts.ide

If I modify my project's pom.xml to use Spring Boot 2.1.9.RELEASE then the "@RequestMappings" view populates immediately after the workspace refreshes.

See also spring-boot #18939

martinlippert commented 4 years ago

This is most likely caused by some incompatibilities between the internally used Spring core framework version and the one your project relies upon (in case of Spring Boot 2.2.1, it is a lot newer). I would recommend to update your tooling environment to the Spring Tools 4 for Eclipse distribution that we ship for a while that doesn't produce those incompatibilities. Would that work for you? If jumping over to Spring Tools 4, you would get a really nice overview of all your request mapping using the "navigate to symbol" quick in-place dialog. WDYT?

lordofthemoon commented 4 years ago

Hi Martin, Apologies for the delay, but I've now upgraded to STS 4.5.1 and the @RequestMappings view is no longer present (it looks like the entire Spring perspective for Eclipse has gone), in favour of the Ctrl-6 shortcut that you mention. That's acceptable, I suppose (although I would still prefer to have it as a view, but that should be a separate issue). You can go ahead and close this issue.

martinlippert commented 4 years ago

@lordofthemoon Thanks for the feedback, much appreciated. I will go ahead and close the issue.

Regarding your preference for the view: what would you like to see in the view? An overview of all the request mappings of the workspace, project, or file? And if it depends, based on what condition? Would love to hear your thoughts on that.

lordofthemoon commented 4 years ago

Hi Martin, I think a view showing all the request mappings in the project would be the most useful for me.

Thanks, Raj.

On 19 Feb 2020, 09:01, at 09:01, Martin Lippert notifications@github.com wrote:

@lordofthemoon Thanks for the feedback, much appreciated. I will go ahead and close the issue.

Regarding your preference for the view: what would you like to see in the view? An overview of all the request mappings of the workspace, project, or file? And if it depends, based on what condition? Would love to hear your thoughts on that.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/spring-projects/spring-ide/issues/398#issuecomment-588109685

kdvolder commented 4 years ago

@lordofthemoon I've started working on view that might replace the request mapping view. It is essentially the same as what appears in the popup when you press CTRL-6. Except this one is a more 'permanent' view that sticks around (i.e. similar to 'Outline', 'Boot Dashboard' and 'Package Explorer' views).

If you want to try it out, you can get STS snapshot build from:

https://dist.springsource.com/snapshot/STS4/nightly-distributions.html

To open the view go to "Window >> Show View > Other >> Spring Symbols".

Use the search box and type @/ to find requestmappings in the workspace.

This is only the first/minimal implementation of it. Curious to know if you think this kind of view will be fine for you as a replacement for the 'request mappings' view of old STS 3.

As this is only the first 'minimal' implementation there are some planned enhancements:

lordofthemoon commented 4 years ago

The following section of this message contains a file attachment prepared for transmission using the Internet MIME message format. If you are using Pegasus Mail, or any other MIME-compliant system, you should be able to save it or view it from within your mailer. If you cannot, please ask your system administrator for assistance.

---- File information ----------- File: DEFAULT.BMP Date: 21 Sep 2001, 14:59 Size: 358 bytes. Type: Unknown

martinlippert commented 4 years ago

@lordofthemoon Looks like something went wrong with your previous comment...

lordofthemoon commented 4 years ago

Oops, sorry. Comment was:

Hi Kris Apologies for the delayed response, but this sounds brilliant. One of the big issues I have with the current popup is that I forget it's there (and when I do remember about it, can never remember the shortcut). Having a view which can be docked on the window would be great.

I've never used a snapshot build before, but I'll take a copy of my workspace and try it out when I get a chance.

Your planned improvements all sound like they'd be very useful additions too. Thanks for this enhancement :).

Hope you're staying safe, Raj.