users@glassfish.java.net

Re: [Fwd: Topic Listener not triggered on a client app]

From: Alexis Midon <alexismidon_at_gmail.com>
Date: Mon, 4 Dec 2006 07:40:48 +0100

Absolutely right!
many thanks Ramesh!

btw I also change my code to look up the destination by jndi instead of
doing "connection.createTopic()"...
my bad


On 12/4/06, Ramesh Parthasarathy <Ramesh.Parthasarathy_at_sun.com> wrote:
>
> Hi Alexis,
>
> I don't see a connection.start() in your code, is it part of some
> other
> method ?
> If not, could you add connection.start() in your initJMS() method.
>
> Thanks
> -Ramesh
>
> Binod wrote On 12/04/06 03:35,:
> >
> > ------------------------------------------------------------------------
> >
> > Subject:
> > Topic Listener not triggered on a client app
> > From:
> > Alexis Midon <alexismidon_at_gmail.com>
> > Date:
> > Sat, 02 Dec 2006 17:25:51 +0100
> > To:
> > users_at_glassfish.dev.java.net
> >
> >
> > Hi all,
> >
> > I'm facing a problem with JMS.
> > Here is the description:
> > A topic named OrderTopic received Orders created by a stateless bean.
> > 2 listeners are waiting for messages: one in the container
> > EmailSenderBean, one in a stand alone client (not in ACC).
> > The problem is that the stand alone client does not received any
> > notification while the EmailSenderBean works perfectly.
> >
> > I've checked the connection url, the topic name, etc in vain.
> >
> > Above you will find the client code creating the listener, the output in
> > the client console, and the output in the server.log file:
> >
> > Thanks in advance
> >
> > Alexis.
> >
> > The Listener creation in the client app:
> >
> > public void initJMS() throws JMSException {
> > connectionFactory = ServiceLocator.getInstance
> > ().getConnectionFactory(conFactoryName);
> > connection = connectionFactory.createConnection();
> > session = connection.createSession(false,
> Session.AUTO_ACKNOWLEDGE);
> > Destination jmsDestination = session.createTopic
> (destinationName);
> > MessageConsumer consumer =
> > session.createConsumer(jmsDestination, messageSelector);
> > System.out.println("Setting listener...");
> > consumer.setMessageListener (this);
> > }
> >
> > on the client console:
> >
> > run-client:
> > [echo] Runs the client application
> > [java] 2 dÚc. 2006 16:39:11
> > com.sun.messaging.jms.ra.ResourceAdapter start
> > [java] INFO: MQJMSRA_RA1101: SJSMQ JMS Resource Adapter starting...
> > [java]
> >
> ================================================================================
> > [java] Sun Java(tm) System Message Queue 4.0
> > [java] Sun Microsystems, Inc.
> > [java] Version: 4.0 (Build 27-a)
> > [java] Compile: Thu 03/02/2006
> >
> > [java] Copyright (c) 2006 Sun Microsystems, Inc. All rights
> reserved.
> > [java] SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license
> terms.
> >
> > [java] This product includes code licensed from RSA Data Security.
> > [java]
> >
> ================================================================================
> >
> > [java] 2 dÚc. 2006 16:39:11
> > com.sun.messaging.jms.ra.ResourceAdapter start
> > [java] INFO: MQJMSRA_RA1101: SJSMQ JMS ResourceAdaapter
> configuration=
> > [java] raUID =null
> > [java] brokerType =REMOTE
> > [java] brokerInstanceName =imqbroker
> > [java] brokerBindAddress =null
> > [java] brokerPort =7676
> > [java] brokerHomeDir
> > =F:\Tools\glassfish-9.0-b48\imq\bin\..
> > [java] brokerVarDir =F:/Tools/glassfish-
> > 9.0-b48/domains/petstore\imq
> > [java] brokerJavaDir
> > =F:/Tools/jdk1.5.0_09/jre/..
> > [java] brokerArgs =null
> > [java] brokerStartTimeout =60000
> > [java] adminUsername =admin
> > [java] adminPassFile =C:\Documents and
> > Settings\Agathe&Alexis\Local Settings\Temp\asmq16330.tmp
> > [java] useJNDIRmiServiceURL =true
> > [java] rmiRegistryPort =1099
> > [java] startRmiRegistry =true
> > [java] useSSLJMXConnector =true
> > [java] brokerEnableHA =false
> > [java] clusterId =null
> > [java] brokerId =null
> > [java] jmxServiceURL =null
> > [java] dbType =null
> > [java] dbProps ={}
> > [java] dsProps ={}
> > [java] ConnectionURL
> =mq://tequasmid:7676/
> > [java] UserName =guest
> > [java] ReconnectEnabled =true
> > [java] ReconnectInterval =5000
> > [java] ReconnectAttempts =3
> > [java] AddressListBehavior =RANDOM
> > [java] AddressListIterations =3
> > [java] InAppClientContainer =true
> > [java] InClusteredContainer =false
> > [java] GroupName =null
> >
> > [java] 2 dÚc. 2006 16:39:11
> > com.sun.messaging.jms.ra.ResourceAdapter start
> > [java] INFO: MQJMSRA_RA1101: start:SJSMQ JMSRA Connection Factory
> > Config={imqOverrideJMSPriority=false, imqConsumerFlowLimit=
> > 1000, imqOverrideJMSExpiration=false, imqAddressListIterations=3,
> > imqLoadMaxToServerSession=true, imqConnectionType=TCP, imqPingIn
> > terval=30, imqSetJMSXUserID=false, imqConfiguredClientID=,
> > imqSSLProviderClassname= com.sun.net.ssl.internal.ssl.Provider, imqJMSDe
> > liveryMode=PERSISTENT, imqConnectionFlowLimit=1000, imqConnectionURL=
> > http://localhost/imq/tunnel, imqBrokerServiceName=, imqJMSPri
> > ority=4, imqBrokerHostName=localhost, imqJMSExpiration=0,
> > imqAckOnProduce=, imqEnableSharedClientID=false, imqAckTimeout=0, imqAck
> > OnAcknowledge=, imqConsumerFlowThreshold=50, imqDefaultPassword=guest,
> > imqQueueBrowserMaxMessagesPerRetrieve=1000, imqDefaultUsern
> > ame=guest, imqReconnectEnabled=false, imqConnectionFlowCount=100,
> > imqAddressListBehavior=RANDOM, imqReconnectAttempts=3, imqSetJMS
> > XAppID=false,
> > imqConnectionHandler=
> com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler
> > , imqSetJMSXRcvTimestamp=false, im
> > qBrokerServicePort=0, imqDisableSetClientID=false,
> > imqSetJMSXConsumerTXID=false, imqOverrideJMSDeliveryMode=false,
> > imqBrokerHostPo
> > rt=7676, imqQueueBrowserRetrieveTimeout=60000,
> > imqSetJMSXProducerTXID=false, imqSSLIsHostTrusted=false,
> > imqConnectionFlowLimitEnab
> > led=false, imqReconnectInterval=5000,
> > imqAddressList=mq://tequasmid:7676/,
> > imqOverrideJMSHeadersToTemporaryDestinations=false}
> > [java] 2 dÚc. 2006 16:39:11
> > com.sun.messaging.jms.ra.ResourceAdapter start
> > [java] INFO: MQJMSRA_RA1101: SJSMQ JMSRA Started
> > [java] 2 dÚc. 2006 16:39:11
> > com.sun.messaging.jms.ra.ManagedConnectionFactory setPassword
> > [java] INFO: MQJMSRA_MF1101: setPassword:NOT setting default value
> > [java] 2 dÚc. 2006 16:39:11
> > com.sun.messaging.jms.ra.ManagedConnectionFactory setAddressList
> > [java] INFO: MQJMSRA_MF1101: setAddressList:NOT setting default
> > value=localhost
> > [java] 2 dÚc. 2006 16:39:11
> > com.sun.messaging.jms.ra.ManagedConnectionFactory setUserName
> > [java] INFO: MQJMSRA_MF1101: setUserName:NOT setting default
> > value=guest
> > [java] connectionFactory =
> > com.sun.messaging.jms.ra.ConnectionFactoryAdapter_at_2c7ac5
> > [java] 2 dÚc. 2006 16:39:12
> > com.sun.messaging.jms.ra.ManagedConnection <init>
> > [java] INFO: MQJMSRA_MC1101: constructor:Created
> > mcId=1:xacId=2446034331570837760:Using xacf
> > config={imqOverrideJMSPriority=f
> > alse, imqConsumerFlowLimit=1000, imqOverrideJMSExpiration=false,
> > imqAddressListIterations=3, imqLoadMaxToServerSession=true, imqCo
> > nnectionType=TCP, imqPingInterval=30, imqSetJMSXUserID=false,
> > imqConfiguredClientID=, imqSSLProviderClassname= com.sun.net.ssl.inte
> > rnal.ssl.Provider, imqJMSDeliveryMode=PERSISTENT,
> > imqConnectionFlowLimit=1000, imqConnectionURL=
> > http://localhost/imq/tunnel, imqBr
> > okerServiceName=, imqJMSPriority=4, imqBrokerHostName=localhost,
> > imqJMSExpiration=0, imqAckOnProduce=, imqEnableSharedClientID=fal
> > se, imqAckTimeout=0, imqAckOnAcknowledge=, imqConsumerFlowThreshold=50,
> > imqDefaultPassword=guest, imqQueueBrowserMaxMessagesPerRet
> > rieve=1000, imqDefaultUsername=guest, imqReconnectEnabled=true,
> > imqConnectionFlowCount=100, imqAddressListBehavior=RANDOM, imqReco
> > nnectAttempts=3, imqSetJMSXAppID=false,
> > imqConnectionHandler=
> com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler,
> > imqSet
> > JMSXRcvTimestamp=false, imqBrokerServicePort=0,
> > imqDisableSetClientID=false, imqSetJMSXConsumerTXID=false,
> > imqOverrideJMSDeliveryM
> > ode=false, imqBrokerHostPort=7676, imqQueueBrowserRetrieveTimeout=60000,
> > imqSetJMSXProducerTXID=false, imqSSLIsHostTrusted=false,
> > imqConnectionFlowLimitEnabled=false, imqReconnectInterval=5000,
> > imqAddressList=mq://tequasmid:7676/, imqOverrideJMSHeadersToTempor
> > aryDestinations=false}
> > [java] connection =
> com.sun.messaging.jms.ra.ConnectionAdapter_at_1f4cdd2
> > [java] session = com.sun.messaging.jms.ra.SessionAdapter_at_15e3dc4
> > [java] jmsDestination = Sun Java System MQ Destination
> > [java] getName(): OrderTopic
> > [java] Class: com.sun.messaging.BasicTopic
> > [java] getVERSION(): 3.0
> > [java] isReadonly(): false
> > [java] getProperties(): {imqDestinationName=OrderTopic,
> > imqDestinationDescription=A Description for the Destination Object
> > }
> > [java] consumer = ConnectionID=2446034331570837760,
> > SessionID=2446034331570861824, ConsumerID=2446034331570869760,
> DestName=O
> > rderTopic
> > [java] Setting listener...
> >
> >
> >
> > in the server.log file:
> >
> > [#|2006-12-02T16:37:
> 23.281+0100|INFO|sun-appserver-pe9.0|javax.resourceadapter.mqjmsra.lifecycle|_ThreadID=10
> ;_ThreadName=main;|MQJMSRA_RA1101:
> > SJSMQ JMS ResourceAdaapter configuration=
> > raUID =null
> > brokerType =EMBEDDED
> > brokerInstanceName =imqbroker
> > brokerBindAddress =null
> > brokerPort =7676
> > brokerHomeDir
> > =F:\Tools\glassfish-9.0-b48\imq\bin\..
> > brokerVarDir
> > =F:/Tools/glassfish-9.0-b48/domains/petstore\imq
> > brokerJavaDir =F:/Tools/jdk1.5.0_09/jre/..
> > brokerArgs =null
> > brokerStartTimeout =60000
> > adminUsername =admin
> > adminPassFile =C:\Documents and
> > Settings\Agathe&Alexis\Local Settings\Temp\asmq16330.tmp
> > useJNDIRmiServiceURL =true
> > rmiRegistryPort =1099
> > startRmiRegistry =true
> > useSSLJMXConnector =true
> > brokerEnableHA =false
> > clusterId =null
> > brokerId =null
> > jmxServiceURL =null
> > dbType =null
> > dbProps ={}
> > dsProps ={}
> > ConnectionURL =
> > UserName =guest
> > ReconnectEnabled =true
> > ReconnectInterval =5000
> > ReconnectAttempts =3
> > AddressListBehavior =RANDOM
> > AddressListIterations =3
> > InAppClientContainer =false
> > InClusteredContainer =false
> > GroupName =null
> > |#]
> >
> > [#|2006-12-02T16:37:
> 23.281+0100|INFO|sun-appserver-pe9.0|javax.resourceadapter.mqjmsra.lifecycle|_ThreadID=10
> ;_ThreadName=main;|MQJMSRA_RA1101:
> > start:SJSMQ JMSRA Connection Factory
> > Config={imqOverrideJMSPriority=false, imqConsumerFlowLimit=1000,
> > imqOverrideJMSExpiration=false, imqAddressListIterations=3,
> > imqLoadMaxToServerSession=true, imqConnectionType=TCP,
> > imqPingInterval=30, imqSetJMSXUserID=false, imqConfiguredClientID=,
> > imqSSLProviderClassname= com.sun.net.ssl.internal.ssl.Provider,
> > imqJMSDeliveryMode=PERSISTENT, imqConnectionFlowLimit=1000,
> > imqConnectionURL= http://localhost/imq/tunnel, imqBrokerServiceName=,
> > imqJMSPriority=4, imqBrokerHostName=localhost, imqJMSExpiration=0,
> > imqAckOnProduce=, imqEnableSharedClientID=false, imqAckTimeout=0,
> > imqAckOnAcknowledge=, imqConsumerFlowThreshold=50,
> > imqDefaultPassword=guest, imqQueueBrowserMaxMessagesPerRetrieve=1000,
> > imqDefaultUsername=guest, imqReconnectEnabled=false,
> > imqConnectionFlowCount=100, imqAddressListBehavior=PRIORITY,
> > imqReconnectAttempts=3, imqSetJMSXAppID=false, imqConnectionHandler=
> > com.sun.messaging.jmq.jmsclient.protocol.tcp.TCPStreamHandler,
> > imqSetJMSXRcvTimestamp=false, imqBrokerServicePort=0,
> > imqDisableSetClientID=false, imqSetJMSXConsumerTXID=false,
> > imqOverrideJMSDeliveryMode=false, imqBrokerHostPort=7676,
> > imqQueueBrowserRetrieveTimeout=60000, imqSetJMSXProducerTXID=false,
> > imqSSLIsHostTrusted=false, imqConnectionFlowLimitEnabled=false,
> > imqReconnectInterval=5000, imqAddressList=localhost:7676,
> > imqOverrideJMSHeadersToTemporaryDestinations=false}|#]
> >
> > [#|2006-12-02T16:37:
> 23.281+0100|INFO|sun-appserver-pe9.0|javax.resourceadapter.mqjmsra.lifecycle|_ThreadID=10
> ;_ThreadName=main;|MQJMSRA_RA1101:
> > SJSMQ JMSRA Started|#]
> >
>
>