spring-attic / spring-ide

Spring Development Environment for Eclipse
300 stars 126 forks source link

Getting Error creating bean with name 'requestMappingHandlerAdapter' in STS only #374

Open Rahulborserb opened 5 years ago

Rahulborserb commented 5 years ago

Hi Team,

In my gradle project I have some spring boot dependencies and now I am trying to add spring boot starter data redis dependency,. But I am getting Error creating bean with name 'requestMappingHandlerAdapter' error while starting the server. I checked with other IDE its working fine. But only in STS I am facing problem. Please help me out.

kdvolder commented 5 years ago

Error creating bean with name 'requestMappingHandlerAdapter

What's the full error?

I checked with other IDE its working fine.

How about when you build / run the project from the commandline? I am asking because what another IDE is doing isn't necessarily 'correct' either. However we should allways strive to have the IDE behavior in line with what command-line tooling is doing. So its more useful to reference the 'CLI' as the 'correct and expected behavior'.

Now, assuming that it works fine on the commandline then... usually the difference in behavior comes down to a difference in the classpath that the IDE uses versus the classpath that happens when launching from CLI.

So to trouble shoot this, you'd have to try and add some code to check / print the classpath on startup, then we can try and spot the difference and try to figure out why it happens and who to blame (e.g. gradle tooling, vs something that STS is doing).

Also a useful experiment to do in this regard is try to launch the project using 'Run As Java Project' instead of 'Run as Spring Boot App'. If it works with one but not the other it provides a hint as to whether Gradle tooling is causing this problem vs STS. If it works with neither than the problem is mostllikely with the Gradle tooling instead.

If you could try some of these and report back that would be really great. Maybe start with 'run as Java' vs 'run as boot', vs run on CLI. As those are fairly easy experiments to do.