I'm trying to setup DCEVM (JDK 1.8 51) and HotSwap-Agent with my GWT/Maven project to be able to reload changes without restarting GWT's Super Devmode. To start with, my project is setup like so:
project
-core
-data
-i18n
where core is the main module where I run mvn gwt:run. It depends on the i18n and data modules, so I'd like those to be reloaded as well. So in my hotswap-agent.properties, I put:
extraClasspath=<pathto>/i18n/target/classes,<pathto>/data/build/target/classes
I've gotten as far as installing DCEVM as the alt jvm, and setup my MAVEN_OPTS like so:
SET MAVEN_OPTS=-XXaltjvm=dcevm -javaagent:<pathto>/hotswap-agent.jar -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic
From here I do mvn gwt:run to start dev mode. HotSwap-Agent seems to properly initialize as evidenced by these lines:
HOTSWAP AGENT: 10:43:6.444 INFO (org.hotswap.agent.HotswapAgent) - Loading Hotswap agent {0.3.0-SNAPSHOT} - unlimited runtime class redefinition.
HOTSWAP AGENT: 10:43:6.663 INFO (org.hotswap.agent.config.PluginRegistry) - Discovered plugins: [Hotswapper, WatchResources, AnonymousClassPatch, Hibernate, Spring, Jersey2, Jetty, Tomcat, ZK, Logback, JSF, Seam, ELResolver, OsgiEquinox, Proxy, WebObjects, Weld]
HOTSWAP AGENT: 11:17:46.400 INFO (org.hotswap.agent.config.PluginRegistry) - Plugin 'org.hotswap.agent.plugin.hotswapper.HotswapperPlugin' initialized in ClassLoader 'java.net.URLClassLoader@4d49f239'.
And then devmode is started, I can run my application and all that.
Now, when I go to do a mvn clean install on data, for example, HotSwap-Agent seems to detect the changes, but this is what I get:
HOTSWAP AGENT: 11:2:38.541 WARNING (org.hotswap.agent.watch.nio.WatcherNIO2) - WatchKey 'sun.nio.fs.WindowsWatchService$WindowsWatchKey@7d9da813' overflowed
And then, a huge list of (it looks like I get a trace for every class in the module):
HOTSWAP AGENT: 11:2:43.945 ERROR (org.hotswap.agent.annotation.handler.WatchEventCommand) - Unable create CtClass for URI 'file:///<pathto>/data/build/target/classes/<packageto>/DashboardWidget$DashboardWidgetMetaData.class'.
java.lang.IllegalArgumentException: java.io.FileNotFoundException: <pathto>\data\build\target\classes\<packageto>\DashboardWidget$DashboardWidgetMetaData.class (The system cannot find the file specified)
at org.hotswap.agent.util.IOUtils.toByteArray(IOUtils.java:50)
at org.hotswap.agent.annotation.handler.WatchEventCommand.createCtClass(WatchEventCommand.java:191)
at org.hotswap.agent.annotation.handler.WatchEventCommand.onWatchEvent(WatchEventCommand.java:120)
at org.hotswap.agent.annotation.handler.WatchEventCommand.executeCommand(WatchEventCommand.java:51)
at org.hotswap.agent.command.impl.CommandExecutor.run(CommandExecutor.java:25)
Caused by: java.io.FileNotFoundException: <pathto>\data\build\target\classes\<packageto>\DashboardWidget$DashboardWidgetMetaData.class (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at java.net.URL.openStream(URL.java:1038)
at org.hotswap.agent.util.IOUtils.toByteArray(IOUtils.java:44)
... 4 more
HOTSWAP AGENT: 11:2:43.945 ERROR (org.hotswap.agent.annotation.handler.WatchEventCommand) - Unable create CtClass for URI 'file:///<pathto>/data/build/target/classes/<packageto>/ItemImage.class'.
java.lang.IllegalArgumentException: java.io.FileNotFoundException: <pathto>\data\build\target\classes\<packageto>\ItemImage.class (The system cannot find the file specified)
at org.hotswap.agent.util.IOUtils.toByteArray(IOUtils.java:50)
at org.hotswap.agent.annotation.handler.WatchEventCommand.createCtClass(WatchEventCommand.java:191)
at org.hotswap.agent.annotation.handler.WatchEventCommand.onWatchEvent(WatchEventCommand.java:120)
at org.hotswap.agent.annotation.handler.WatchEventCommand.executeCommand(WatchEventCommand.java:51)
at org.hotswap.agent.command.impl.CommandExecutor.run(CommandExecutor.java:25)
Caused by: java.io.FileNotFoundException: <pathto>\data\build\target\classes\<packageto>\ItemImage.class (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at java.net.URL.openStream(URL.java:1038)
at org.hotswap.agent.util.IOUtils.toByteArray(IOUtils.java:44)
... 4 more
This all occurs when hotswap-agent notices a change in my core module as well.
After all that, the program resumes properly, but the changes don't take affect, even if I refresh the browser. I get no search results when I look up the overflow message or the filenotfound exceptions (in reference to hotswap-agent). So, I don't really know what's going on. Any help would be great!