-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help, the new Controller API interface cannot be hot updated. #544
Comments
@skybber Help me~ |
@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:/hotswap-agent.jar=autoHotswap=true', and JVM I am using is JBR 17. @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. |
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
The text was updated successfully, but these errors were encountered: