HotswapProjects / HotswapAgent

Java unlimited redefinition of classes at runtime.
GNU General Public License v2.0
2.36k stars 493 forks source link

HotswapAgent not working and throws "<CLASS_PATH> not valid, removing path=" #377

Open engr-Eghbali opened 3 years ago

engr-Eghbali commented 3 years ago

Hi folks, I’m facing an issue and I could use some help, please. My ENV:

Dcevm-11.0.9+1 (2020-11-24) Intellij 202.6397.94 Centos7 Spring-Boot 2.1.6.RELEASE

And I followed these guides : https://github.com/HotswapProjects/HotswapAgent & https://github.com/TravaOpenJDK/trava-jdk-11-dcevm

What I get after recompile my classes is like:

HOTSWAP AGENT: 19:49:11.740 WARNING (org.hotswap.agent.watch.nio.WatcherNIO2) - Watcher on not valid, removing path=

And my services not updating****. I traced the source code and found this if it's related:

// reset key and remove from set if directory no longer accessible
        boolean valid = key.reset();
        if (!valid) {
            LOGGER.warning("Watcher on {} not valid, removing path=", keys.get(key));
            keys.remove(key);

In addition, if it helps, I attached a part of the application logs on start.


HOTSWAP AGENT: 19:44:12.986 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.spring.SpringPlugin' initialized in ClassLoader 'jdk.internal.loader.ClassLoaders$AppClassLoader@3b192d32'.
HOTSWAP AGENT: 19:44:12.987 INFO (org.hotswap.agent.plugin.spring.SpringPlugin) - Spring plugin initialized - Spring core version '5.1.8.RELEASE'

2020-11-18 19:44:13.261  INFO 31796 --- [           main] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2020-11-18 19:44:13.262  INFO 31796 --- [           main] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
HOTSWAP AGENT: 19:44:13.336 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.hibernate.HibernatePlugin' initialized in ClassLoader 'jdk.internal.loader.ClassLoaders$AppClassLoader@3b192d32'.
HOTSWAP AGENT: 19:44:13.647 INFO (org.hotswap.agent.plugin.spring.SpringPlugin) - Registering basePackage com.wow.hrmanagement.*
HOTSWAP AGENT: 19:44:13.885 INFO (org.hotswap.agent.plugin.spring.SpringPlugin) - Registering basePackage com.wow.commons.*

HOTSWAP AGENT: 19:44:16.339 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.tomcat.TomcatPlugin' initialized in ClassLoader 'TomcatEmbeddedWebappClassLoader
  context: ROOT
  delegate: true
----------> Parent Classloader:
jdk.internal.loader.ClassLoaders$AppClassLoader@3b192d32
'.
HOTSWAP AGENT: 19:44:16.339 INFO (org.hotswap.agent.plugin.tomcat.TomcatPlugin) - Tomcat plugin initialized - Tomcat version '9.0.21.0'
skybber commented 3 years ago

Are you using autoHotswap and extraClassPath?

engr-Eghbali commented 3 years ago

@skybber No sir...

coelhodeoliveira commented 3 years ago

Hello, I also have a lot of those warnings:

HOTSWAP AGENT: 13:39:27.775 WARNING (org.hotswap.agent.watch.nio.WatcherNIO2) - Watcher on PROJECT_PATH not valid, removing path=

PROJECT_PATH is my is the full path to the file like /User/xxx/xxx/xxx

And I am using only the option "autoHotswap=true".