-1

我是用户 Hermes-JMS 尝试在 Java 消息队列上显示消息。

当我选择“无法显示消息”的消息错误时,原因是 Class Cast 错误。

有没有办法将 Hermes 指向我的对象(设置 Hermes 的类路径),以便它可以使用 toString 方法显示它在队列中看到的消息。

4

1 回答 1

0

I found the solution. First go to your IDE and export to JAR (in RAD or eclipse this is simply right click export) and include all your projects. This should create a jar file with all your class files. Even if you are doing a war or ear file, just export to jar file so Hermes can read it.

Then in Hermes click on options -> configuration select the Providers tab expand the class path groups that already exist (important don't create a new group this was where I was making my mistake every time I tried, just use the existing one)

Right click on "Library" and select add jar file, select the jar file you create above, select ok and scan, you might have to do the add jar again for each jar you added to your project that your classes depend on.

于 2016-09-15T11:29:37.220 回答