Mirth 运行旧 JAR 文件代码

发布于 2024-10-10 16:30:38 字数 1081 浏览 0 评论 0原文

这真的让我发疯。无论我做什么,Mirth (1.8.2) 似乎都在运行我的 JAR 文件的旧版本;我知道是因为各种迹象,例如:

  • 我无法调用任何函数 记录的
  • 信息未显示在日志中
  • 更改的日志消息未在日志文件中更改
  • 曾经在代码中创建和写入但不再触及的文件通过代码,仍在创建和编写

我已经尝试了我能想到的一切来完成这项工作。它曾经一度可以工作,但现在似乎不再更新。我将更改集成到 Mirth 的过程是:

  • 运行 ant 脚本来构建 JAR 文件
  • 将 JAR 文件复制到 \lib\custom
  • 重新启动 Mirth 服务(通过 Mirth 管理员)

我尝试重新启动(通过 Services、Java、电脑)——无济于事。我知道我的 JAR 文件是正确的,因为我已经对其进行了反编译(以确保它具有最新的代码)并对它进行了哈希处理(以与 ant 构建的 JAR 的哈希值进行比较)——它是正确的并且代码就在那里;它只是没有被运行。

我已无计可施;这种情况很少发生,但完全阻碍了我的发展。

编辑:我也知道我的代码是正确的,因为当我运行单元测试时,它会生成正确的文件并调用正确的函数并记录正确的信息。只有欢乐似乎“不明白”。

我的课程非常简单;简单的单参数构造函数和一些返回各种数据的公共方法。没有什么复杂的,没有嵌套的类/JAR/依赖项。

编辑:我什至删除了自定义 JAR 文件并重新启动 Mirth,它仍然在运行我的代码。太棒了:/我已经为这个问题添加了赏金。我怀疑 JAR 被缓存在某个地方(尽管他们在 Mirth 论坛上否认了这一点),并且该缓存需要以某种方式清除(尽管为什么重新启动 Mirth 服务而我的 PC 却没有这样做,这超出了我的范围)。

我还终止了所有 Java 实例(并重新启动了我的计算机),因此 JVM 极不可能在某处缓存 JAR。

我尝试重新安装 Mirth。由于某种原因,当我第一次启动管理员时,它有我的自定义频道;令人恼火的是,它仍然运行旧的 JAR,尽管我已经在 lib\custom 中使用新的 JAR 对其进行了更新。

This is really driving me crazy. No matter what I do, it seems that Mirth (1.8.2) is running an older version of my JAR file; I know because of various signs, like:

  • I can't call any functions
  • Information logged is not showing up in the logs
  • Changed log messages are not changed in the log files
  • Files that were once created and written to in code, but no longer touched by code, are still being created and written

I've tried everything I can think of to make this work. It was working at one point, but now it seems like it's no longer being updated. My process to integrate my changes into Mirth are:

  • Run an ant script to build the JAR file
  • Copy the JAR file to \lib\custom
  • Restart the Mirth service (via Mirth administrator)

I've tried restarting (Mirth service via Services, Java, computer) -- to no avail. I know my JAR file is correct, because I've decompiled it (to make sure it has the latest code) and hashed it (to compare to the hash of the ant-built JAR) -- it is correct and the code is there; it's just not being run.

I'm at wit's end; this occurs infrequently but completely blocks me from developing.

Edit: I also know that my code is correct, because when I run unit tests, it generates the right files and calls the right functions and logs the right information. Only Mirth seems to "not get it."

And my classes are very simple; simple one-argument constructors and a few public methods that return various data. Nothing complex, no nested classes/JARs/dependencies.

Edit: I even deleted my custom JAR file and restarted Mirth, and it's still running my code. Awesome :/ I've added a bounty for this question. I suspect the JAR is cached somewhere (even though they deny it on the Mirth forums) and that cache needs to be cleaned out somehow (although why restarting the Mirth service and my PC doesn't do it is beyond me).

I've also killed all instances of Java (and rebooted my computer), so that makes it highly unlikely that the JVM is caching the JAR somewhere.

I tried reinstalling Mirth. For some reason, it had my custom channel when I booted the administrator for the first time; and infuriatingly, it's still running the old JAR, even though I've updated it with the new one in lib\custom.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

短暂陪伴 2024-10-17 16:30:38

我最终通过一系列操作解决了这个问题:

  • 卸载 Mirth 和 Java,然后重新安装。
  • 我还删除了除一个(一个 JDK 和一个 JRE)之外的所有 Java 安装。
  • 当你复制我的 JAR 时,我停止了 Mirth。停止 Mirth,复制,然后重新启动;不要尝试复制实时安装。它可能会也可能不会获取更新的 JAR,具体取决于它是否已加载到 JVM 中。

这些步骤的组合似乎有效。在此之前,我安装了 3-4 个 JRE(以及两个 JDK),并且在 Mirth 运行时复制(成功,根据 Windows 7)JAR。现在正在工作!

I ended up solving this with a combination of actions:

  • Uninstalling Mirth and Java, and then reinstalling.
  • I also removed all Java installations except one (one JDK and one JRE).
  • I stopped Mirth when you copying my JAR. Stop Mirth, copy, and restart; don't try to copy on a live installation. It may or may not pick up your updated JAR depending on if it's loaded into a JVM or not.

This combination of steps seemed to work. Prior to this, I had 3-4 JREs installed (and two JDKs) and I was copying (successfully, according to Windows 7) the JARs while Mirth was running. It's working now!

剑心龙吟 2024-10-17 16:30:38

Mirth 是一个运行在普通旧式 JVM 上的 J2EE 应用程序;您可以选择调试它。

您可以按照此处 用于通过 Eclipse 运行 Mirth Connect。然后您可以看到 JVM 类路径,可以设置断点并使用调试器。

Mirth 基于 Mule ESB。 Mule 有自己的类加载方式。你可以研究一下。

如果 Mirth 确实使用旧版本的 JAR,那么可能它在某个地方有一个缓存版本。或者也许您做了一些您已经忘记的配置更改 - 也许您为 jar 添加了一个新目录。 (不知道你是怎么做到的。)

Mule 关注一个名为 MULE_LIB 的环境变量;也许这是相关的。

看起来 Mirth Connect 1.8 和 Mirth Connect 2.0 的 jar 位置不同(分别为 lib/custom 和 custom-lib)。您使用的是哪个版本?

Mirth is a J2EE application running on a plain old JVM; you have options for debugging it.

You could follow the instructions here for running Mirth Connect via Eclipse. You could then see the JVM classpath, you could set breakpoints and use the debugger.

Mirth is based on the Mule ESB. Mule has its own way of class-loading. You could research it.

If Mirth is really using an old version of your JAR, maybe it's got a cached version around somewhere. Or maybe you made some configuration changes you've forgotten about - perhaps you added a new directory for jars. (Not sure how you do that.)

Mule pays attention to an environment variable named MULE_LIB; maybe that's relevant.

It looks like Mirth Connect 1.8 and Mirth Connect 2.0 have different places for jars (lib/custom and custom-lib, respectively). Which version are you using?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文