users@glassfish.java.net

RE: How to connect to remote JMS

From: David Zhao <liang.x.zhao_at_oracle.com>
Date: Wed, 19 Dec 2012 18:09:13 -0800 (PST)

Hi Andy,

If you want to connect to a 3rd party JMS provider from glassfish, please try Generic JMSRA (http://genericjmsra.java.net/). The embedded JMSRA in glassfish is for connecting to glassfish MQ only.

Thanks,
David Zhao


> -----Original Message-----
> From: Andreas Junius [mailto:AJunius_at_internode.com.au]
> Sent: Thursday, December 20, 2012 9:23 AM
> To: users_at_glassfish.java.net
> Subject: How to connect to remote JMS
>
> Hi all,
>
> I try to setup a jms connection factory to a TIBCO EMS on a remote
> machine.
>
> The resource type is javax.jms.ConnectionFactory
>
> Pool settings default, no transaction. I added also UserName, Password
> and AddressList (Format: dev-esb:7222).
>
> However it does not work. If I try to connect (or ping) I'll get the
> following exception:
>
> WARNING: [C4003]: Error occurred on connection creation [dev-esb:7222].
> - cause: java.lang.NumberFormatException: For input string: "
>
> I can easily connect to the JMS programmatically, so I'm sure it works.
> The only difference is, that the code uses a TIBCO class for the
> factory: TibjmsQueueConnectionFactory
>
>
> Is this a bug or did I forget any important settings? What's the
> precise procedure to connect to a remote JMS?
>
> Cheers,
> Andy
>
>
> The exception:
>
> Dec 20, 2012 9:42:15 AM org.hibernate.validator.internal.util.Version
> <clinit>
> INFO: HV000001: Hibernate Validator 4.3.0.Final Dec 20, 2012 9:42:16 AM
> com.sun.messaging.jms.ra.ResourceAdapter start
> INFO: MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter: Version:
> 4.5.2 Patch 1 (Build 3-d) Compile: Thu Jun 7 10:46:15 PDT 2012 Dec
> 20, 2012 9:42:16 AM com.sun.messaging.jms.ra.ResourceAdapter start
> INFO: MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter starting:
> broker is REMOTE, connection mode is TCP Dec 20, 2012 9:42:16 AM
> com.sun.messaging.jms.ra.ResourceAdapter start
> INFO: MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter Started:REMOTE
> Dec 20, 2012 9:42:16 AM
> com.sun.messaging.jmq.jmsclient.ExceptionHandler
> throwConnectionException
> WARNING: [C4003]: Error occurred on connection creation
> [10.20.13.131:7222]. - cause: java.lang.NumberFormatException: For
> input string: "
>
> com.sun.messaging.jms.JMSException: [C4003]: Error occurred on
> connection creation [10.20.13.131:7222]. - cause:
> java.lang.NumberFormatException: For input string: "
> at
> com.sun.messaging.jmq.jmsclient.ExceptionHandler.throwConnectionExcepti
> on(ExceptionHandler.java:280)
> at
> com.sun.messaging.jmq.jmsclient.ExceptionHandler.handleConnectException
> (ExceptionHandler.java:226)
> at
> com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMa
> pperClient.java:262)
> at
> com.sun.messaging.jmq.jmsclient.PortMapperClient.init(PortMapperClient.
> java:156)
> at
> com.sun.messaging.jmq.jmsclient.PortMapperClient.<init>(PortMapperClien
> t.java:98)
> at
> com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPConnectionHandler.<init
> >(TCPConnectionHandler.java:168)
> at
> com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler.openConne
> ction(TCPStreamHandler.java:141)
> at
> com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(Co
> nnectionInitiator.java:785)
> at
> com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnectionNew
> (ConnectionInitiator.java:260)
> at
> com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(Co
> nnectionInitiator.java:214)
> at
> com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(Co
> nnectionInitiator.java:164)
> at
> com.sun.messaging.jmq.jmsclient.ProtocolHandler.init(ProtocolHandler.ja
> va:843)
> at
> com.sun.messaging.jmq.jmsclient.ProtocolHandler.<init>(ProtocolHandler.
> java:1562)
> at
> com.sun.messaging.jmq.jmsclient.ConnectionImpl.openConnection(Connectio
> nImpl.java:2427)
> at
> com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java
> :1108)
> at
> com.sun.messaging.jmq.jmsclient.ConnectionImpl.<init>(ConnectionImpl.ja
> va:459)
> at
> com.sun.messaging.jmq.jmsclient.UnifiedConnectionImpl.<init>(UnifiedCon
> nectionImpl.java:66)
> at
> com.sun.messaging.jmq.jmsclient.XAConnectionImpl.<init>(XAConnectionImp
> l.java:64)
> at
> com.sun.messaging.XAConnectionFactory.createXAConnection(XAConnectionFa
> ctory.java:97)
> at
> com.sun.messaging.jms.ra.ManagedConnection.<init>(ManagedConnection.jav
> a:196)
> at
> com.sun.messaging.jms.ra.ManagedConnectionFactory.createManagedConnecti
> on(ManagedConnectionFactory.java:226)
> at
> com.sun.enterprise.resource.allocator.NoTxConnectorAllocator.createReso
> urce(NoTxConnectorAllocator.java:128)
> at
> com.sun.enterprise.resource.pool.ConnectionPool.createSingleResource(Co
> nnectionPool.java:907)
> at
> com.sun.enterprise.resource.pool.ConnectionPool.createResource(Connecti
> onPool.java:1189)
> at
> com.sun.enterprise.resource.pool.datastructure.RWLockDataStructure.addR
> esource(RWLockDataStructure.java:98)
> at
> com.sun.enterprise.resource.pool.ConnectionPool.addResource(ConnectionP
> ool.java:282)
> at
> com.sun.enterprise.resource.pool.ConnectionPool.createResourceAndAddToP
> ool(ConnectionPool.java:1512)
> at
> com.sun.enterprise.resource.pool.ConnectionPool.createResources(Connect
> ionPool.java:944)
> at
> com.sun.enterprise.resource.pool.ConnectionPool.initPool(ConnectionPool
> .java:230)
> at
> com.sun.enterprise.resource.pool.ConnectionPool.internalGetResource(Con
> nectionPool.java:511)
> at
> com.sun.enterprise.resource.pool.ConnectionPool.getResource(ConnectionP
> ool.java:381)
> at
> com.sun.enterprise.resource.pool.PoolManagerImpl.getResourceFromPool(Po
> olManagerImpl.java:245)
> at
> com.sun.enterprise.resource.pool.PoolManagerImpl.getResource(PoolManage
> rImpl.java:170)
> at
> com.sun.enterprise.connectors.ConnectionManagerImpl.getResource(Connect
> ionManagerImpl.java:338)
> at
> com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnecti
> on(ConnectionManagerImpl.java:301)
> at
> com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(
> ConnectionManagerImpl.java:236)
> at
> com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(
> ConnectionManagerImpl.java:165)
> at
> com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(
> ConnectionManagerImpl.java:160)
> at
> com.sun.messaging.jms.ra.ConnectionFactoryAdapter._allocateConnection(C
> onnectionFactoryAdapter.java:181)
> at
> com.sun.messaging.jms.ra.ConnectionFactoryAdapter.createConnection(Conn
> ectionFactoryAdapter.java:168)
> at
> com.sun.messaging.jms.ra.ConnectionFactoryAdapter.createConnection(Conn
> ectionFactoryAdapter.java:150)
> at info.junius.GFMessageSender.main(GFMessageSender.java:22)
> Caused by: java.lang.NumberFormatException: For input string: "
> at
> java.lang.NumberFormatException.forInputString(NumberFormatException.ja
> va:65)
> at java.lang.Integer.parseInt(Integer.java:481)
> at java.lang.Integer.parseInt(Integer.java:527)
> at
> com.sun.messaging.jmq.io.PortMapperTable.read(PortMapperTable.java:277)
> at
> com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMa
> pperClient.java:243)
> ... 39 more
> Dec 20, 2012 9:42:57 AM
> com.sun.enterprise.resource.allocator.NoTxConnectorAllocator
> createResource
> WARNING: RAR5038:Unexpected exception while creating resource for pool
> jms/iiNetTibcoConnectionFactory. Exception :
> javax.resource.spi.ResourceAdapterInternalException: MQJMSRA_MC4001:
> constructor:Aborting:JMSException on createConnection=[C4003]: Error
> occurred on connection creation [10.20.13.131:7222]. - cause:
> java.lang.NumberFormatException: For input string: "
> at
> com.sun.messaging.jmq.jmsclient.ExceptionHandler.throwConnectionExcepti
> on(ExceptionHandler.java:280)
> at
> com.sun.messaging.jmq.jmsclient.ExceptionHandler.handleConnectException
> (ExceptionHandler.java:226)
> at
> com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMa
> pperClient.java:262)
> at
> com.sun.messaging.jmq.jmsclient.PortMapperClient.init(PortMapperClient.
> java:156)
> at
> com.sun.messaging.jmq.jmsclient.PortMapperClient.<init>(PortMapperClien
> t.java:98)
> at
> com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPConnectionHandler.<init
> >(TCPConnectionHandler.java:168)
> at
> com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler.openConne
> ction(TCPStreamHandler.java:141)
> at
> com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(Co
> nnectionInitiator.java:785)
> at
> com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnectionNew
> (ConnectionInitiator.java:260)
> at
> com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(Co
> nnectionInitiator.java:214)
> at
> com.sun.messaging.jmq.jmsclient.ConnectionInitiator.createConnection(Co
> nnectionInitiator.java:164)
> at
> com.sun.messaging.jmq.jmsclient.ProtocolHandler.init(ProtocolHandler.ja
> va:843)
> at
> com.sun.messaging.jmq.jmsclient.ProtocolHandler.<init>(ProtocolHandler.
> java:1562)
> at
> com.sun.messaging.jmq.jmsclient.ConnectionImpl.openConnection(Connectio
> nImpl.java:2427)
> at
> com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java
> :1108)
> at
> com.sun.messaging.jmq.jmsclient.ConnectionImpl.<init>(ConnectionImpl.ja
> va:459)
> at
> com.sun.messaging.jmq.jmsclient.UnifiedConnectionImpl.<init>(UnifiedCon
> nectionImpl.java:66)
> at
> com.sun.messaging.jmq.jmsclient.XAConnectionImpl.<init>(XAConnectionImp
> l.java:64)
> at
> com.sun.messaging.XAConnectionFactory.createXAConnection(XAConnectionFa
> ctory.java:97)
> at
> com.sun.messaging.jms.ra.ManagedConnection.<init>(ManagedConnection.jav
> a:196)
> ... 22 more
> Caused by: java.lang.NumberFormatException: For input string: "
> at
> java.lang.NumberFormatException.forInputString(NumberFormatException.ja
> va:65)
> at java.lang.Integer.parseInt(Integer.java:481)
> at java.lang.Integer.parseInt(Integer.java:527)
> at
> com.sun.messaging.jmq.io.PortMapperTable.read(PortMapperTable.java:277)
> at
> com.sun.messaging.jmq.jmsclient.PortMapperClient.readBrokerPorts(PortMa
> pperClient.java:243)
> ... 39 more
>
>
>
>
>