问题描述
我试图从独立的远程客户端连接到GlassFish 3的JMS服务。但是我得到一个java.lang.ClassNotFoundException:com.sun.messaging.jms.ra.ResourceAdapter。关于如何解决这个问题的任何想法?
这是我的设置到目前为止:
- 添加到独立应用程序的类路径中的gf-client-module.jar(在GLASSFISH_HOME / modules中)。还尝试添加模块目录中存在的其他jar(例如jms-core.jar),但仍然得到相同的ClassNotFoundException。
JNDI属性指定如下:
java.naming.factory.initial = com.sun.enterprise.naming.SerialInitContextFactory
java.naming.factory.url。 pkgs = com.sun.enterprise.naming
java.naming.factory.state = com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl
任何帮助将不胜感激。
好的。我找到了解决方案。请参阅此处的细节,但简短的答案是,我需要添加两个罐子类路径:imqjmsra.jar和imqbroker.jar。这些可以在名为imqjmsra.rar的rar中找到,它可以在glassfish的mq目录下找到。我必须从这个rar中提取两个罐子!
I am trying to connect to GlassFish 3's JMS service from a standalone remote client. However I am getting a java.lang.ClassNotFoundException: com.sun.messaging.jms.ra.ResourceAdapter. Any ideas on how to fix this?
Here's my setup so far:
Glassfish 3 JMS Service in LOCAL mode (I am assuming that EMBEDED mode will not work in this case because it bypasses the network stack)
JNDI properties are specified as follows:
java.naming.factory.initial=com.sun.enterprise.naming.SerialInitContextFactoryjava.naming.factory.url.pkgs=com.sun.enterprise.namingjava.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl
gf-client-module.jar (in GLASSFISH_HOME/modules) added to the standalone application's classpath. Also tried adding other jars present in the modules directory (such as jms-core.jar), but still getting the same ClassNotFoundException.
Any help would be much appreciated.
Ok. I found a solution. See here for details, but the short answer is that I needed to add two jars to the classpath: imqjmsra.jar and imqbroker.jar. These were available inside a rar called imqjmsra.rar which can be found under glassfish's mq directory. I had to extract the two jars from this rar!
这篇关于将远程JMS客户端连接到GlassFish 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!