开发者

JBoss 5 JMS Jars Needed to use it

I need to configure the JMS in JBoss 5. I'm looking for the jars to do so. Does anyone knows wh开发者_运维技巧at Jars are needed to compile this lines of code?

    h.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
    h.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
    h.put("java.naming.provider.url", "localhost:1099");
    InitialContext i = new InitialContext(h);

I'm looking for the packages needed to compile. Always throws and ClassNotFoundException NamingContextFactory not found.

In JBoss 4 the jars are concurrent.jar, jbossmq-client.jar, jboss-common-client.jar, jboss-system-client.jar, jnp-client.jar and log4j.jar.

what are the JBoss 5 jars?


If you use Eclipse for Java EE as IDE, then all you need to do is just create JBoss Server Runtime, and in build path of your project add Server Runtime library, and all jars from JBoss AS will be added to your classpath, no need to look for them, everything will be compiled.

Here you can see what is used by JBoss AS 5.x to service JMS (look for "Remove JMS (Java Message Service)" on that page), some of jars are located there, some of jars are in common/lib folder of server (jboss-messaging.jar, jboss-messaging-int.jar, jnpserver.jar), some are located in lib folder (concurent.jar, jboss-common-core.jar, and jboss-system.jar). But better to use approach with IDE, does not help? Also be careful.

JBoss Messaging is a high performance JMS provider in the JBoss Enterprise Middleware Stack (JEMS), included with JBoss 5 as the default messaging provider. It is also the backbone of the JBoss ESB infrastructure. JBoss Messaging is a complete rewrite of JBossMQ, which is the default JMS provider for the JBoss AS 4.x series

UPDATE: to use Server Runtime library, maybe you will need to install JBoss Tools, I just don't remember if Eclipse can load all jars from JBoss without it.


To compile that code, you don't need JBoss at all, all of the required classes (including InitialContext) are in the standard JavaSE 6 API.

Assuming that you actually want to run the code, though, you need the JARs in $JBOSS_HOME/client, including jnp-client.jar.


After adding all jars from client directory, the application seems to connect to JMS queue, but then it throws exception:



    DEBUG [WatchDog] - SocketClientInvoker[186f3b3, bisocket://192.168.1.84:4457] setting client socket wrapper class name to org.jboss.jms.client.remoting.ClientSocketWrapper
    DEBUG [WatchDog] - SocketClientInvoker[186f3b3, bisocket://192.168.1.84:4457] setting shouldCheckConnection to false
    DEBUG [WatchDog] - SocketClientInvoker[186f3b3, bisocket://192.168.1.84:4457] setting timeout to 0
    DEBUG [WatchDog] - SocketClientInvoker[186f3b3, bisocket://192.168.1.84:4457] constructed
    DEBUG [WatchDog] - SocketClientInvoker[186f3b3, bisocket://192.168.1.84:4457] setting client socket wrapper class name to org.jboss.jms.client.remoting.ClientSocketWrapper
    DEBUG [WatchDog] - SocketClientInvoker[186f3b3, bisocket://192.168.1.84:4457] setting shouldCheckConnection to false
    DEBUG [WatchDog] - SocketClientInvoker[186f3b3, bisocket://192.168.1.84:4457] setting timeout to 0
    DEBUG [WatchDog] - Setting ping frequency to: 214748364
    DEBUG [WatchDog] - SocketClientInvoker[186f3b3, bisocket://192.168.1.84:4457] connecting
    DEBUG [WatchDog] - Creating semaphore with size 50
    DEBUG [WatchDog] - SocketClientInvoker[186f3b3, bisocket://192.168.1.84:4457] connected
    DEBUG [WatchDog] - SocketClientInvoker[feecca, bisocket://192.168.1.84:4457] setting maxPoolSize to 200
    DEBUG [WatchDog] - SocketClientInvoker[feecca, bisocket://192.168.1.84:4457] setting client socket wrapper class name to org.jboss.jms.client.remoting.ClientSocketWrapper
    DEBUG [WatchDog] - SocketClientInvoker[feecca, bisocket://192.168.1.84:4457] setting shouldCheckConnection to false
    DEBUG [WatchDog] - SocketClientInvoker[feecca, bisocket://192.168.1.84:4457] setting timeout to 0
    DEBUG [WatchDog] - SocketClientInvoker[feecca, bisocket://192.168.1.84:4457] constructed
    DEBUG [WatchDog] - SocketClientInvoker[feecca, bisocket://192.168.1.84:4457] setting maxPoolSize to 200
    DEBUG [WatchDog] - SocketClientInvoker[feecca, bisocket://192.168.1.84:4457] setting client socket wrapper class name to org.jboss.jms.client.remoting.ClientSocketWrapper
    DEBUG [WatchDog] - SocketClientInvoker[feecca, bisocket://192.168.1.84:4457] setting shouldCheckConnection to false
    DEBUG [WatchDog] - SocketClientInvoker[feecca, bisocket://192.168.1.84:4457] setting timeout to 0
    DEBUG [WatchDog] - Setting ping frequency to: 214748364
    DEBUG [WatchDog] - SocketClientInvoker[feecca, bisocket://192.168.1.84:4457] connecting
    DEBUG [WatchDog] - Creating semaphore with size 200
    DEBUG [WatchDog] - SocketClientInvoker[feecca, bisocket://192.168.1.84:4457] connected
    DEBUG [WatchDog] - SocketClientInvoker[feecca, bisocket://192.168.1.84:4457] got exception: ClientSocketWrapper[Socket[addr=/192.168.1.84,port=4457,localport=57267].169dd64]
    java.io.IOException: org.jboss.remoting.InvocationResponse
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:179)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at org.jboss.jms.wireformat.SerializedPacket.read(SerializedPacket.java:73)
        at org.jboss.jms.wireformat.JMSWireFormat.read(JMSWireFormat.java:298)
        at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.versionedRead(MicroSocketClientInvoker.java:1222)
        at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:850)
        at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:426)
        at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:165)
        at org.jboss.remoting.MicroRemoteClientInvoker.establishLease(MicroRemoteClientInvoker.java:467)
        at org.jboss.remoting.Client.setupClientLease(Client.java:1715)
        at org.jboss.remoting.Client.connect(Client.java:1615)
        at org.jboss.remoting.Client.connect(Client.java:515)
        at org.jboss.jms.client.remoting.JMSRemotingConnection$1.run(JMSRemotingConnection.java:354)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:350)
        at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:158)
        at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeTarget(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
        at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:81)
        at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect_z_handleCreateConnectionDelegate_23582715.invoke(StateCreationAspect_z_handleCreateConnectionDelegate_23582715.java)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
        at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
        at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)
        at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)
        at org.jetel.connection.jms.JmsConnection.initConnection(JmsConnection.java:393)
        at org.jetel.connection.jms.JmsConnection.preExecute(JmsConnection.java:359)
        at org.jetel.graph.TransformationGraph.preExecute(TransformationGraph.java:481)
        at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:196)
        at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:64)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.lang.Thread.run(Thread.java:619)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜