Closed nanxing7 closed 9 months ago
这个bug是Spring5以SpringBoot FatJar启动时spring失效的问题,这个在HotSecondsExtension的Spring5ResourceLoaderInjectClassLoaderPatch中修复了,可以打包HotSecondsExtension成jar包引用试试,过段时间我发布一下中央仓库
Spring5ResourceLoaderInjectClassLoaderPatch
还是不行
hot-seconds-remote.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- 一键秒级远程热部署配置文件 -->
<!-- 此配置文件一共两套,为hot-seconds.xml和hot-seconds-remote.xml -->
<liubs>
<!-- 这个是本地和远程连接的唯一id,务必保证hot-seconds.xml和hot-seconds-remote.xml相等 -->
<secret>aaaaaaaabbbbbbbbbccccccccc</secret>
<!-- 远程端口 -->
<remote_port>2023</remote_port>
<init_delay>3000</init_delay>
<!--
普通java项目填 AppClassLoader,
Tomcat项目填 WebappClassLoader/ParallelWebappClassLoader(Tomcat8及以后的版本填ParallelWebappClassLoader),
SpringBoot项目填 LaunchedURLClassLoader
-->
<classloader>LaunchedURLClassLoader</classloader>
<!-- 这里的扩展classname是热加载某个文件的前置和后置操作,需要实现IHotExtHandler接口,复制IHotExtHandler.java到工程即可 -->
<dev-ext>
<classname>com.liubs.hotseconds.extension.AutoChoose</classname>
</dev-ext>
</liubs>
启动命令
java -XXaltjvm=dcevm -javaagent:/root/HotSecondsServer/HotSecondsServer.jar=hotconf=/root/hot-deploy/hot-seconds-remote.xml -jar /root/hot-deploy/hot-deploy.jar
HotSecondsServer-future4.1已修复,我试了下可以了,HotSecondsExtension无需引用
HotSecondsServer-future4.1已修复,我试了下可以了,HotSecondsExtension无需引用
我测试也可以使用了
HOTSECONDS: 15:11:36.102 INFO Plugin 'org.hotswap.agent.plugin.tomcat.TomcatPlugin' initialized in ClassLoader 'TomcatEmbeddedWebappClassLoader context: ROOT delegate: true ----------> Parent Classloader: org.springframework.boot.loader.LaunchedURLClassLoader@74ad1f1f '. HOTSECONDS: 15:11:36.103 INFO Tomcat plugin initialized - Tomcat version '9.0.75.0'