0

My goal is to substitute JRebel with DCEVM/Hotswap for a Tomcat project built with Maven. I believe it is detecting my class file changes and handling them appropriately. However, it is not detecting resource changes.

I started with the assumption that it would load everything that the JVM normally would. Next, I added a hotswap-agent.properties file, and have not gotten that to work either.

hotswap-agent.properties

extraClasspath=
watchResources=src/main/resources
LOGGER=debug

I also tried watchResources= and watchResources=true

It's not clear to me what the format of "watchResources" should be.

For IP reasons, I cannot paste the full log file in a public forum, but did see this:

HOTSWAP AGENT: 14:21:27.546 DEBUG (org.hotswap.agent.util.classloader.WatchResourcesClassLoader) - Watching directory 'file:/C:/Software/src/main/resources' for changes.
HOTSWAP AGENT: 14:21:27.547 INFO (org.hotswap.agent.watch.nio.TreeWatcherNIO) - Registering directory target C:\Software\src\main\resources via watched: C:\Software\src\main\resources
HOTSWAP AGENT: 14:21:27.547 DEBUG (org.hotswap.agent.watch.nio.TreeWatcherNIO) - WATCHING: ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY - fileTree,high C:\Software\src\main\resources

Interestingly, my files are not under C:\Software\src\main\resources, but rather something like C:\Repos\myproject\src\main\java and c:\Repos\myproject\src\main\resources.

If it matters, the resource is a MyBatis mapper XML file.

I'd like some message that says it detected a change in the resource and an appropriate message.

Woodsman
  • 901
  • 21
  • 61
  • @GhostCat The reason is price. I cannot convince my manager to spend US$625 on a per developer license. It's unfortunate because everything I've seen suggests that the commercial version is better. – Woodsman Sep 11 '19 at 01:43
  • True, it is rather expensive. But have you talked to the jrebel folks? There are discounts you know. Luckily for us, restarting our software can take 5 or 10 minutes. Even more sometimes. So we could tell managers that preventing just one restart per day saves the company money in the long run. – GhostCat Sep 11 '19 at 03:49
  • I tried adding ${basedir} to the watchResources, but it treated it as a literal, instead of substituting the value. – Woodsman Sep 16 '19 at 22:20
  • 1
    Last HotswapAgent version supports reloading of MyBatis mapper files. – skybber Jan 06 '20 at 14:11

0 Answers0