0

有没有人在使用 Trinidad 时实现了 Java 库(甚至编译的 Java 类)的热部署?

我的 Rails 应用程序在 Trinidad 上运行,并且依赖于 Java 后端,该后端在my-rails/lib/java. 当这些 jar 之一发生更改时,Trinidad 服务器不会重新加载它。touch tmp/restart.txt仅重新加载应用程序上下文。

请注意,我的问题与 无关config.autoload_paths,因为据我所知,此选项仅用于重新加载 Ruby 文件。


更新
我未能实现我的java依赖项的热部署并放弃了。对我来说唯一的帮助是单元测试,我每次都在本地启动以检查我的代码。

4

1 回答 1

1

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.

于 2013-12-18T08:35:32.353 回答