Open XuxuGood opened 8 months ago
@skybber Help me~
Unfortunately, I'm not a Spring user at all. Maybe @cvictory or @beiwei30 could help.
@XuxuGood I couldn't reproduce the issue you report.
pls. verify with the attached demo app. I can disable and enable '/greeting2' successfully by commenting out the second method (greeting2) back and forth.
The JVM option I am using is '-XX:HotswapAgent=external -javaagent:
@RestController
public class GreetingController {
private final GreetingService service;
public GreetingController(GreetingService service) {
this.service = service;
}
@RequestMapping("/greeting")
public @ResponseBody GreetingResponse greeting() {
return service.greet();
}
//
// @RequestMapping("/greeting2")
// public @ResponseBody GreetingResponse greeting2() {
// return service.greet();
// }
}
As far as I know, it works well and I do some test about this case. Can you provide a demo ?
A strange problem was detected today. The specific steps to reproduce are as follows:
There is an initial Controller when the service is started, and the interface does not have hello2. At this time, first access the hello2 interface on the page, and a 404 will be reported:
接着我在Controller添加hello接口,同时变更springboot application.properties中配置,同时热更新这两个文件到extraClasspath目录下。
However, when the hello2 interface is actually accessed again, the error code is still 404, and the interface has not been hot updated.
extraClasspath目录内容如下:
Version: java: 8u181 dcevm: 8u181 hotswapagent: 1.4.2-SNAOSHOT
Service start: java -XXaltjvm=dcevm -javaagent:/www/app-preview/hotswapagent-1.4.2-SNAPSHOT.jar=autoHotswap=true,propertiesFilePath=/www/app-preview/hotswap-agent.properties -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8005 -jar /www/app-preview/app/app-preview-push-1.0.0-SNAPSHOT.jar