Skip to content
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

Open
XuxuGood opened this issue Mar 18, 2024 · 4 comments
Open

Help, the new Controller API interface cannot be hot updated. #544

XuxuGood opened this issue Mar 18, 2024 · 4 comments

Comments

@XuxuGood
Copy link

XuxuGood commented Mar 18, 2024

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:

image image

接着我在Controller添加hello接口,同时变更springboot application.properties中配置,同时热更新这两个文件到extraClasspath目录下。

image image

However, when the hello2 interface is actually accessed again, the error code is still 404, and the interface has not been hot updated.

extraClasspath目录内容如下:
image

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

@XuxuGood XuxuGood changed the title The new api interface cannot be hot updated Help, the new Controller API interface cannot be hot updated. Mar 19, 2024
@XuxuGood XuxuGood reopened this Mar 19, 2024
@XuxuGood
Copy link
Author

@skybber Help me~

@skybber
Copy link
Contributor

skybber commented Mar 19, 2024

Unfortunately, I'm not a Spring user at all. Maybe @cvictory or @beiwei30 could help.

XuxuGood added a commit to XuxuGood/HotswapAgent that referenced this issue Mar 21, 2024
XuxuGood added a commit to XuxuGood/HotswapAgent that referenced this issue Mar 21, 2024
XuxuGood added a commit to XuxuGood/HotswapAgent that referenced this issue Mar 22, 2024
XuxuGood added a commit to XuxuGood/HotswapAgent that referenced this issue Mar 22, 2024
@beiwei30
Copy link
Contributor

beiwei30 commented Aug 5, 2024

@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.

demo.tar.gz

@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();
//    }
}

@cvictory
Copy link
Contributor

cvictory commented Aug 6, 2024

As far as I know, it works well and I do some test about this case.
Can you provide a demo ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants