Good working hot swap with kotlin

Hi everybody,

I’ve been searching for years to find a good working solution for hot swapping classes in Jmix (and before I tried the same for CUBA) with Kotlin. Everything I tried resulted in a more bad than good result.

I’m running the DCEVM 11.0.11 with the HotswapAgent

I’ve even tried writing a custom HotswapAgent plugin - with limited success.

With the Single Hotswap - IntelliJ IDEs Plugin | Marketplace IntelliJ plugin it’s working at least sometimes for single files, but more often than not the hot swap stalls or the application breaks, because some spring component can’t be found - although I didn’t touch the source code since the last application start.

My setup right now is:

  • Jmix 1.4
  • Kotlin
  • DCEVM 11.0.11
  • dependencies: (spring dev tools + hotswap agent)
    implementation 'org.springframework.boot:spring-boot-devtools'

    compileOnly 'org.hotswapagent:hotswap-agent:1.4.1'
    compileOnly 'org.hotswapagent:hotswap-agent-core:1.4.1'
    compileOnly 'org.hotswapagent:hotswap-agent-spring-plugin:1.4.1'
    compileOnly 'org.hotswapagent:hotswap-agent-vaadin-plugin:1.4.1'

Would be awesome if anybody has got some more ideas + solutions + … (anything really) regarding this topic, as this restart-application-cycles kill so much productivity!

1 Like

I need to dynamically, during runtime, create or change underlying database objects, and then update the Eclipselink ORM layer. I have been looking around, and while there are indications that things you mentioned may work with Hibernate, they will not with Eclipselink. I found that JRebel supports Eclipselink, so I will be trying that in January when I clear some tasks. It’s 500 bucks bite, but there is a trial period to test. I like that it doesn’t require special JVM distribution, as it acts as an addition to the existing JVM. My customers would never accept distribution such as DCEVM. I also like that the license is tied to a person, so I would be able to install as many JRebel installations as I want, as explained by their sales.

I’ve come accross JRebel during researching hot swap functionality of course, but never tried it myself. From what I’ve read it also has many problems and doesn’t work so well “out-of-the-box” as is promised by them though. Would be still interesting to try out.

For the DCEVM JVM part: I only use that during development and I only need the hot swap functionality during development.

If you use JRebel, don’t forget to turn off Jmix hot deploy in Jmix Plugin Settings.
And please share your experience.

2 Likes