Spring loaded 1.2.5 + Spring Boot 1.3.2. can't seem to get it to work
Asked Answered
L

2

2

I came across a video on youtube ( https://www.youtube.com/watch?v=GTrNkhVnJBU ) where it demos Spring Loaded.

I'm trying to duplicate the same behavior but am still unsuccessful so far.

What I'm using:

Spring Tool Suite 3.7.2 Spring Boot 1.3.2-RELEASE Spring loaded 1.2.5-RELEASE Maven version 3.1.0 JDK 1.8.0_71

I tried the same thing as the guy does in the video (except for the versions being more up to date of course) but it doesn't work.

I also tried the "maven plugin" way as described in the spring docs here -> https://docs.spring.io/spring-boot/docs/current/reference/html/howto-hotswapping.html#howto-reload-springloaded-maven But that also did not work.

I tried changing the versions of spring loaded to 1.2.0 (docs use that version) but that didn't do anything either.

I ran the app in STS itself, and also tried mvn spring-boot:run from command line, but both simply don't get the desired result.

When using mvn spring-boot:run I see that it is attaching the agent:

[INFO] Attaching agents: [C:\Users\ron.m2\repository\org\springframework\springloaded\1.2.5.RELEASE\springloaded-1.2.5.RELEASE.jar]

But changing RequestMappings or method signatures do not get picked up by spring loaded and thus the change is not reflected.

I'm a little out of ideas why I can't get this to work and any help would be greatly appreciated.

Lillalillard answered 26/1, 2016 at 12:53 Comment(0)
I
4

Spring loaded does not yet support spring 4.2. See https://github.com/spring-projects/spring-loaded/issues/139

So you either stick with DevTools which definitely speeds up the development process (although not as fast as spring-loaded), use JRebel (which supports the latest spring version) or downgrade to spring 4.1.

Importune answered 26/1, 2016 at 19:38 Comment(1)
That was it, thx! When I set spring boot to version 1.2.8 it works. Only when using mvn spring-boot:run from commandline though. When I use the -javaagent vm argument, I can also get it to work in Eclipse.Lillalillard
U
0

As an alternative you could also try the automatic restart feature of Spring Boot Devtools: https://spring.io/blog/2015/06/17/devtools-in-spring-boot-1-3. It restarts just the app and it is much quicker than restarting the whole JVM. You are loosing application state though, but it might be an alternative.

Unbeaten answered 27/1, 2016 at 10:4 Comment(1)
Yeah I already know about that one. Pitty that you loose the application state, but heck, for REST API's (which I'm making now) an application restart is usually something that can be lived with during development.Lillalillard

© 2022 - 2024 — McMap. All rights reserved.