Reload jars from lib directory when using Trinidad (JRuby and RoR 3)

134 views Asked by At

Has anyone achieved hot-deployment of Java libraries (or even compiled Java classes) when using Trinidad?

My Rails application runs on Trinidad and depends on a Java backend that is packed as many jars under my-rails/lib/java. When one of these jars changes, Trinidad server doesn't reload it. touch tmp/restart.txt only reloads the app context.

Please note that my question is not related to config.autoload_paths, because as far as I know this option is used only to reload Ruby files.


UPDATED
I failed to achieve hot-deployment of my java dependencies and gave up. The only help for me were unit tests which I was launching locally every time to check my code.

1

There are 1 answers

2
kares On

I think if the .jar does not get reloaded than it's probably a Trinidad bug (since during context restarts jars should be re-added - assuming Tomcat does this by default - I'm not sure) ... would be great to know details (in Trinidad's tracker) e.g. if the jar is named the same, how does the configuration look like (if any).

The other option would be to try out a rolling restart since than a brand new context is created - thus it should pick up anything that the context depends on from the file-system.

Please note that auto-reloading on file changes such as changing a .jar file even though might work with Tomcat is on purpose disabled in Trinidad - you need to "explicitly" (touch ...) to request a restart.