Single MDB on a clustered JMS queues(2)

I have 2 JMS servers in a cluster and each server has a JMS queue, which forms the distributed destination. Now I need a MDB to listen on both these queues. Is it possible?
Thanks
-Ankur

Yes - thats the usual purpose of distributed queues, to allow consumers to consume from the distributed queue (wherever its hosted).
Though distributed destinations are JMS provider specific so do check your providers documentation on using distributed queues. In some providers, like ActiveMQ, distributed queues look and act just like regular queues so they just work from inside a JMS client or MDB.
James
http://logicblaze.com/

Similar Messages

  • MDB not listening to JMS Queue

    We are using OC4J 10.1.2 We are using JMS for queueing, the Queueing application sucessfully displays the JMS message id, but MDB is NOT listening to the JMS for some reason. We have verified the deployment config files etc. Can amy one help

    1 - It doesn't appear that targets were set for any of the administered WL objects. In WL, most administered objects must have a configured target so that WL knows which servers to run them on.
              2 - There's no need to specify a URL or initial-context-factory in the MDB. In your case, you're referencing JNDI objects on the MDB's local cluster (which, in turn, map to foreign references).
              3 - Note that URL and connection-factory have been re-specified in the foreign JMS server properties, and there 's a mix of delimiters ";" and " ". Normally, no JNDI props are needed except, depending on the use case, for security credentials.

  • Multiple Topics/Queue for Single MDB?

    Hi -
    Is it possible to configure single MDB to handle multiple Topic/Queue in JMS? I used two <jndi-name/> tags for two topics, but only the first one got picked up by the AS7 server. If one MDB can be configured to take multiple topics, how should I configure it? Some configuration example would be most helpful.
    Thanks!

    Hello,
    According to the Ejb 2.1 specifications, in section 15.4.12 "Association of a Message-Driven Bean with a Destination or Endpoint.
    A message-driven bean is associated with a destination or endpoint when the bean is deployed in the container. It is the responsibility of the Deployer to associate the message-driven bean with a destination or endpoint."
    Based on this sentence, I would be led to beleive that a single mdb reading on multiple destinations would not be supported. You can try x-posting this to the application server forum.
    If you desire the same behavior for the multiple topics, you could always use inheritance on your mdb class, or transfer the logic code into a helper class that is reused by multiple, independent MDBs classes....

  • MDBs in 9.1 continue to consume JMS queues even after being deleted

    <b>We have an MDB application that reads a batch message off of a JMS queue, archives it in a database, parses the batch message into individual messages and writes them onto other JMS queues to be consumed by another application. Everything was running fine in Weblogic 8.1.5. However, due to problems with XA drivers and the MSDTC(predictable SQL server crashes), we decided to upgrade to Weblogic 9.1 to take advantage of the LLR option.</b>
              <b>First, we had an issue where our MDBs were causing the following exception:</b>
              <i>####<May 26, 2006 7:42:12 PM EDT> <Error> <JMX> <ist-clft2> <wltest1> <ExecuteThread: '1' for queue: 'default'> <<WLS Kernel>> <> <> <1148686932991> <BEA-149500> <An exception occurred while registering the MBean null.
              java.lang.IllegalArgumentException: Registered more than one instance with the same objectName : com.bea:ServerRuntime=wltest1,MessageDrivenEJBRuntime=RhapsodyMDB_DMBModule!JMSServer4@DMB_BEAN_QUEUE,Name=RhapsodyMDB_DMBModule!JMSServer4@DMB_BEAN_QUEUE,ApplicationRuntime=DataBrokerEAR1_2,Type=EJBPoolRuntime,EJBComponentRuntime=DataBrokerEJB new:[email protected] existing weblogic.ejb.container.monitoring.EJBPoolRuntimeMBeanImpl@7db003
                   at weblogic.management.jmx.ObjectNameManagerBase.registerObject(ObjectNameManagerBase.java:146)
                   at weblogic.management.mbeanservers.internal.WLSObjectNameManager.lookupObjectName(WLSObjectNameManager.java:133)
                   at weblogic.management.jmx.modelmbean.WLSModelMBeanFactory.registerWLSModelMBean(WLSModelMBeanFactory.java:86)
                   at weblogic.management.mbeanservers.internal.RuntimeMBeanAgent$1.registered(RuntimeMBeanAgent.java:104)
                   at weblogic.management.provider.internal.RegistrationManagerImpl.invokeRegistrationHandlers(RegistrationManagerImpl.java:205)
                   at weblogic.management.provider.internal.RegistrationManagerImpl.register(RegistrationManagerImpl.java:85)
                   at weblogic.management.runtime.RuntimeMBeanDelegate.register(RuntimeMBeanDelegate.java:320)
                   at weblogic.management.runtime.RuntimeMBeanDelegate.<init>(RuntimeMBeanDelegate.java:257)
                   at weblogic.management.runtime.RuntimeMBeanDelegate.<init>(RuntimeMBeanDelegate.java:222)
                   at weblogic.ejb.container.monitoring.EJBPoolRuntimeMBeanImpl.<init>(EJBPoolRuntimeMBeanImpl.java:32)
                   at weblogic.ejb.container.monitoring.MessageDrivenEJBRuntimeMBeanImpl.<init>(MessageDrivenEJBRuntimeMBeanImpl.java:49)
                   at weblogic.ejb.container.manager.MessageDrivenManager.initialize(MessageDrivenManager.java:503)
                   at weblogic.ejb.container.manager.MessageDrivenManager.setup(MessageDrivenManager.java:120)
                   at weblogic.ejb.container.manager.MessageDrivenManager.setup(MessageDrivenManager.java:146)
                   at weblogic.ejb.container.deployer.MessageDrivenBeanInfoImpl.createMDManager(MessageDrivenBeanInfoImpl.java:1481)
                   at weblogic.ejb.container.deployer.MessageDrivenBeanInfoImpl.createDDMDManagers(MessageDrivenBeanInfoImpl.java:1378)
                   at weblogic.ejb.container.deployer.MessageDrivenBeanInfoImpl.onDDMembershipChange(MessageDrivenBeanInfoImpl.java:1285)
                   at weblogic.jms.common.CDS$DD2Listener.listChange(CDS.java:454)
                   at weblogic.jms.common.CDSServer$DDHandlerChangeListener.statusChangeNotification(CDSServer.java:167)
                   at weblogic.jms.dd.DDHandler.callListener(DDHandler.java:318)
                   at weblogic.jms.dd.DDHandler.callListeners(DDHandler.java:344)
                   at weblogic.jms.dd.DDHandler.run(DDHandler.java:282)
                   at weblogic.jms.common.SerialScheduler.run(SerialScheduler.java:37)
                   at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
              >
              ####<May 26, 2006 7:42:13 PM EDT> <Info> <EJB> <ist-clft2> <wltest1> <ExecuteThread: '1' for queue: 'default'> <<WLS Kernel>> <> <> <1148686933069> <BEA-010060> <The Message-Driven EJB: RhapsodyMDB has connected/reconnected to the JMS destination: weblogic.jms.DMB_BEAN_QUEUE.></i>
              <b>
              Generally this happend after there were cluster communication issues. Multi-cast messages were lost and our MDB reconnects to the JMS queues as indicated by the below log:</b>
              <i>####<May 30, 2006 5:19:06 PM EDT> <Info> <EJB> <AMTC-RAP-STG3> <RAPBEA1S> <[ACTIVE] ExecuteThread: '54' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1149023946040> <BEA-010060> <The Message-Driven EJB: DataBrokerMDB has connected/reconnected to the JMS destination: weblogic.jms.PHINMS_DMB_QUEUE.>
              ####<May 30, 2006 5:19:10 PM EDT> <Info> <Cluster> <AMTC-RAP-STG3> <RAPBEA1S> <[ACTIVE] ExecuteThread: '22' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1149023950228> <BEA-000112> <Removing RAPBEA3S jvmid:720875810499147484S:cmts-rap-bea3:[7005,-1,-1,-1,-1,-1,-1]:DMBstg:RAPBEA3S from cluster view due to timeout.>
              ####<May 30, 2006 5:19:11 PM EDT> <Info> <Cluster> <AMTC-RAP-STG3> <RAPBEA1S> <[STANDBY] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1149023951009> <BEA-000115> <Lost 2 multicast message(s).>
              ####<May 30, 2006 5:19:11 PM EDT> <Info> <Cluster> <AMTC-RAP-STG3> <RAPBEA1S> <[ACTIVE] ExecuteThread: '22' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1149023951040> <BEA-000111> <Adding RAPBEA3S with ID 720875810499147484S:cmts-rap-bea3:[7005,-1,-1,-1,-1,-1,-1]:DMBstg:RAPBEA3S to cluster: DMBstg_cluster view.></i>
              <b>
              This would cause the queues to eventually have hundreds of consumers and cause the server to fail.
              Basically, it seems as though the MDBs that are supposed to stop continue and attempt to process, while new threads connect to the JMS queues.
              I tried undeploying our application and deleted it from the configuration. However there were consumers still on the respective queues and when I sent messages, I got an error indicating a "Class Not Found exception" due to the fact that the EJB was undeployed and deleted from the configuration, however the MDB component was not and continued to listen for messages. In 8.1.5, as soon as the application was undeployed, there were zero consumers on the JMS queues.
              I have read the posts about a soon to be released fix that would have the MDBs connect only to the queues locally and not go out the the cluster. Would this fix my issue?
              Is there something in the deployment descriptor to configure that will cause it to disconnect and now spawn so many consumers to the JMS queues?
              Why is it that the number of MDB consumers on the JMS queues stayed static in 8.1.5, but they are erratic in 9.1 even after I set our 9.1 server to use the 8.1.5 execute queue policy. Help would be much appreciated.</b>

    I recommend contacting customer support. There's a known problem with MDBs listening to distributed destinations that are local to the same cluster as the MDB, you're problem may be related (the clue is that the stack trace contains jms.dd.DDHandler.callListeners()). The problem is that the MDB connects to all physical queues in a distributed destination rather than just the local queue.
              Tom

  • Getting events into WLI from  External JMS Queue

    Hi,
    I can't figure out how to get an event into WLI from an external JMS queue.
    I can send an XML message to an external queue but can't figure out how to get
    a message from an external queue into WLI. I have created the MDB using the generator
    program provided and have deployed. How does this MDB now send these messages
    into WLI?
    I have also posted this same question in weblogic.interest.jms newsgroup.
    -- Bill

    Hi Bill.
    Actually this is really simple. Here are the steps:
    Connect your MDB to the external JMS queue by modifying the weblogic-ejb-jar.xml
    The MDB onMessage(Message m) method will receive a message from the external JMS
    queue. It will then use JNDI to bind to the EventQueue of WLI and submit the event
    as XML into that queue.
    Obvously the onMessage() operation must be transacted using container managed
    transactions so the scope will spawn both de-queuing from the external JMS queue
    and enqueing into the WLI Evnet Queue.
    "Bill Ozeroff" <[email protected]> wrote:
    >
    Hi,
    I can't figure out how to get an event into WLI from an external JMS
    queue.
    I can send an XML message to an external queue but can't figure out how
    to get
    a message from an external queue into WLI. I have created the MDB using
    the generator
    program provided and have deployed. How does this MDB now send these
    messages
    into WLI?
    I have also posted this same question in weblogic.interest.jms newsgroup.
    -- Bill

  • Data retrieval from JMS queue using single SOA composite in a clustered env

    Hi,
    I have following situation:
    1) A requester SOA composite (Composite1)is reading data from a File
    2) Mediator is routing data received from Composite1 and writing in a JMS queue.
    3) A provider composite (Composite2) is reading from the JMS queue.
    Both Composite1 and Composite2 is deployed in a clustered environment.
    Problem is Composite2 is not able to read data sequentially from JMS Queue sometime (for example out of 30000 transactions its failing once). Here it's a queue and only one producer and only one consumer is there.
    What may cause this issue? I thought a single producer and single consumer on a queue will guarantee FIFO retrieval . Could you please advise where may be the gap?
    Thanks
    Edited by: user1054373 on Sep 18, 2012 11:29 PM

    Hi,
    I thought a single producer and single consumer on a queue will guarantee FIFO retrieval Java Message Service Specification does not guarantee ordered message delivery when applications use distributed queues...
    Using Weblogic Message Unit-of-Order may solve your issue...
    http://docs.oracle.com/cd/E23943_01/web.1111/e13727/uoo.htm#JMSPG389
    Hope this helps...
    Cheers,
    Vlad

  • MDB in a Cluster using Local JMS Queue (not distributed)

              Can I create a MDB that receives messages from a Local JMS Queue (created on each
              node) rather than a distributed queue?
              When I try to deploy such an MDB I get the following exception:
              weblogic.management.DeploymentException: Exception:weblogic.management.ApplicationException:
              activate failed for TestLocalMDBCluster Module: TestLocalMDBCluster Error: Exception
              activating module: EJBModule(TestLocalMDBCluster,status=PREPARED) Unable to deploy
              EJB: AsyncProcessor from TestLocalMDBCluster.jar: [EJB:011046]Unable to create
              EJBRuntimeMBean. javax.management.InstanceAlreadyExistsException: mydomain:ApplicationRuntime=Node2_TestLocalMDBCluster,EJBComponentRuntime=Node2_TestLocalMDBCluster_TestLocalMDBCluster,Location=Node2,Name=Node2_TestLocalMDBCluster_TestLocalMDBCluster_AsyncProcessor_jms/myserver,ServerRuntime=Node2,Type=MessageDrivenEJBRuntime
              at com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:134)
              at com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.java:2371)
              at com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:876)
              at weblogic.management.internal.RemoteMBeanServerImpl.private_registerMBean(RemoteMBeanServerImpl.java:582)
              at weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBeanServerImpl.java:524)
              at weblogic.management.runtime.RuntimeMBeanDelegate.register(RuntimeMBeanDelegate.java:166)
              at weblogic.management.runtime.RuntimeMBeanDelegate.<init>(RuntimeMBeanDelegate.java:122)
              at weblogic.management.runtime.RuntimeMBeanDelegate.<init>(RuntimeMBeanDelegate.java:85)
              at weblogic.ejb20.monitoring.EJBRuntimeMBeanImpl.<init>(EJBRuntimeMBeanImpl.java:33)
              at weblogic.ejb20.monitoring.MessageDrivenEJBRuntimeMBeanImpl.<init>(MessageDrivenEJBRuntimeMBeanImpl.java:30)
              at weblogic.ejb20.deployer.MessageDrivenBeanPoolInfoImpl.initPool(MessageDrivenBeanPoolInfoImpl.java:182)
              at weblogic.ejb20.deployer.MessageDrivenBeanPoolInfoImpl.activate(MessageDrivenBeanPoolInfoImpl.java:245)
              at weblogic.ejb20.deployer.MessageDrivenBeanInfoImpl.activatePoolInfo(MessageDrivenBeanInfoImpl.java:474)
              at weblogic.ejb20.deployer.MessageDrivenBeanInfoImpl.deploy(MessageDrivenBeanInfoImpl.java:440)
              at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1327) at weblogic.ejb20.deployer.EJBModule.activate(EJBModule.java:610)
              at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:3127)
              at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2081)
              at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2062)
              at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592)
              at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
              at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
              at weblogic.management.deploy.slave.SlaveDeployer.commitUpdate(SlaveDeployer.java:608)
              at weblogic.drs.internal.SlaveCallbackHandler$2.execute(SlaveCallbackHandler.java:35)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
              Is there any way to do this?
              

    I assume you are using queues.
              I truly wonder what you are doing different. Since the
              error is occuring outside of JMS and in the EJB - before JMS is called -
              I suggest posting to the ejb newsgroup.
              Note that yours is a standard use case which distributed destinations
              are actually specifically designed for (if you
              are using customer connection factories, just
              make sure ServerAffinity is enabled on the connection factory to
              ensure that clients always connect to the local physical destination,
              configure the MDB to refer to the JNDI name of the distributed
              destination, and then target the MDB to the cluster - an MDB pool
              will then automatically be dedicated to each physical destination).
              Tom
              Mark Colwell wrote:
              > Nope. It happens every time we try the scenario no matter what the application
              > is or which cluster. It always happens if we try to deploy even just a single
              > MDB (no other beans in the jar) to a cluster where the queue specified in the
              > deployment descripter is a local queue created on each node in the cluster. When
              > the jar is deployed we get the error.
              >
              > We have a strange situation were we really need the queue to be local and not
              > distributed but existing on every node. We can create all the local queues no
              > problem but trying to then deploy the application goes boom.
              >
              > Thanks for the response!
              >
              > Cheers,
              > Mark
              >
              > Tom Barnes <[email protected].bea.com>
              > wrote:
              >
              >>Mark Colwell wrote:
              >>
              >>
              >>>Can I create a MDB that receives messages from a Local JMS Queue (created
              >>
              >>on each
              >>
              >>>node) rather than a distributed queue?
              >>
              >>Yes. In fact this is the most common use case.
              >>
              >>
              >>>When I try to deploy such an MDB I get the following exception:
              >>
              >>I don't recall seeing this exception before. It looks like a naming
              >>conflict - it appears that somehow something is already running with
              >>the same name. Are you somehow deploying the same app twice?
              >>
              >>javax.management.InstanceAlreadyExistsException:
              >>mydomain:ApplicationRuntime=Node2_TestLocalMDBCluster,
              >>EJBComponentRuntime=Node2_TestLocalMDBCluster_TestLocalMDBCluster,
              >>Location=Node2,
              >>Name=Node2_TestLocalMDBCluster_TestLocalMDBCluster_AsyncProcessor_jms/myserver,
              >>ServerRuntime=Node2,
              >>Type=MessageDrivenEJBRuntime
              >>
              >>FYI: As of one or two weeks ago, the MDB section of the
              >>EJB docs has been heavily updated. I highly recommend
              >>reading it.
              >>
              >>
              >>>weblogic.management.DeploymentException: Exception:weblogic.management.ApplicationException:
              >>>activate failed for TestLocalMDBCluster Module: TestLocalMDBCluster
              >>
              >>Error: Exception
              >>
              >>>activating module: EJBModule(TestLocalMDBCluster,status=PREPARED) Unable
              >>
              >>to deploy
              >>
              >>>EJB: AsyncProcessor from TestLocalMDBCluster.jar: [EJB:011046]Unable
              >>
              >>to create
              >>
              >>>EJBRuntimeMBean. javax.management.InstanceAlreadyExistsException: mydomain:ApplicationRuntime=Node2_TestLocalMDBCluster,EJBComponentRuntime=Node2_TestLocalMDBCluster_TestLocalMDBCluster,Location=Node2,Name=Node2_TestLocalMDBCluster_TestLocalMDBCluster_AsyncProcessor_jms/myserver,ServerRuntime=Node2,Type=MessageDrivenEJBRuntime
              >>>at com.sun.management.jmx.RepositorySupport.addMBean(RepositorySupport.java:134)
              >>>at com.sun.management.jmx.MBeanServerImpl.internal_addObject(MBeanServerImpl.java:2371)
              >>>at com.sun.management.jmx.MBeanServerImpl.registerMBean(MBeanServerImpl.java:876)
              >>>at weblogic.management.internal.RemoteMBeanServerImpl.private_registerMBean(RemoteMBeanServerImpl.java:582)
              >>>at weblogic.management.internal.RemoteMBeanServerImpl.registerMBean(RemoteMBeanServerImpl.java:524)
              >>>at weblogic.management.runtime.RuntimeMBeanDelegate.register(RuntimeMBeanDelegate.java:166)
              >>>at weblogic.management.runtime.RuntimeMBeanDelegate.<init>(RuntimeMBeanDelegate.java:122)
              >>>at weblogic.management.runtime.RuntimeMBeanDelegate.<init>(RuntimeMBeanDelegate.java:85)
              >>>at weblogic.ejb20.monitoring.EJBRuntimeMBeanImpl.<init>(EJBRuntimeMBeanImpl.java:33)
              >>>at weblogic.ejb20.monitoring.MessageDrivenEJBRuntimeMBeanImpl.<init>(MessageDrivenEJBRuntimeMBeanImpl.java:30)
              >>>at weblogic.ejb20.deployer.MessageDrivenBeanPoolInfoImpl.initPool(MessageDrivenBeanPoolInfoImpl.java:182)
              >>>at weblogic.ejb20.deployer.MessageDrivenBeanPoolInfoImpl.activate(MessageDrivenBeanPoolInfoImpl.java:245)
              >>>at weblogic.ejb20.deployer.MessageDrivenBeanInfoImpl.activatePoolInfo(MessageDrivenBeanInfoImpl.java:474)
              >>>at weblogic.ejb20.deployer.MessageDrivenBeanInfoImpl.deploy(MessageDrivenBeanInfoImpl.java:440)
              >>>at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1327)
              >>
              >>at weblogic.ejb20.deployer.EJBModule.activate(EJBModule.java:610)
              >>
              >>>at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:3127)
              >>>at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2081)
              >>>at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2062)
              >>>at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592)
              >>>at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515)
              >>>at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317)
              >>>at weblogic.management.deploy.slave.SlaveDeployer.commitUpdate(SlaveDeployer.java:608)
              >>>at weblogic.drs.internal.SlaveCallbackHandler$2.execute(SlaveCallbackHandler.java:35)
              >>>at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at
              >>
              >>weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
              >>
              >>>Is there any way to do this?
              >>
              >
              

  • MDB,MDB container or JMS adapter stops processing messages from JMS queue

    Hi guys,
    we have created a component using Enterprise Java Beans, let's say a product catalog, deployed it on a Glassfish v2 instance, and connected it to a legacy system using JMS and Sun MQ v4.1 as messaging system. The catalog component thus starts one MDB that listens on a JMS queue, let's say a queue named catalog_business_events_in, and waits for incoming messages, i.e. in our case update events. The problem is, that in general this approach works well, but sometimes the MDBs/JMS adapter stops for some reason fetching and processing messages from the JMS queue. We don't know why - no exceptions, etc.. Seems to be a Glassfish EJB container, JMS adapter or Sun MQ configuration issue. It seems to be that our component is not the problem.
    The messages are compressed/uncompressed by Sun MQ automatically. We actually have 2 Sun MQ instances in clustered mode running to have some kind of failover - no HA cluster, yet. Sun MQ instances are accessed from Glassfish instances running in different Glassfish clusters - so we have a dedicated Sun MQ cluster not a Sun MQ instance per Glassfish instance. Each Glassfish instance is configured such that it knows both Sun MQ instances to allow automatic failover.
    Has someone an idea, why the MDBs/ MDB container/ JMS adapter - stops processing messages? We are kind of puzzled as it happens more often now and apparently when traffic is (very) low not high!
    Thanks for your help.
    Cheers,
    Martin
    Edited by: east1979 on Jan 13, 2009 8:06 AM

    Hi Manoj,
    I have a very similar if not identical issue,
    Error while running realtime jobs that read from JMS tables via JMS MQ adapter:
    15/11/12 09:10:08  JMS GET OPERATION ERROR : TIMEOUT.UNABLE TO RECEIVE RESPONSE FROM THE INVOKED DATA SERVICES SERVICE.ADAPTER OPERA
    TION TO CONTINUE.
    15/11/12 09:10:15  Communication Error. See real time job log for details.
    Dump available:
    https://sapmats.wdf.sap.corp/download/download.cgi?id=5C0KZAHA3RSXBJW3ABLMUUT2P5UUKWO2TM3EJDM5W2HGDZUDID
    Version of DS:14.0.3.273
    Any comments?
    Thansk and kind Regards,
    Kenneth

  • Making DB updates and sending message to JMS queue enclosed in a single transaction

              using a container managed transactions can we achieve sending a message to the JMS
              queue and updating DB as part of single transaction with the data base driver not
              supporting XA. If yes what all configurations setting I need to do. I tried to achieve
              this using 2PC but I am getting the error that "javax.transaction.xa.XAException:
              JDBC driver does not support XA, hence cannot be a participant in two-phase commit.
              To force this participation, set the enableTwoPhaseCommit property on the corresponding
              JDBCTxDataSourceproperty, to true. Pool = ejbPool".
              

    As far as I know, your only options is to do as the exception you cut-and-pasted below
              states:
              "To force this participation, set the enableTwoPhaseCommit property on the corresponding
              JDBCTxDataSourceproperty, to true. Pool = ejbPool"
              The "enableTwoPhaseCommit" property has definite drawbacks
              see the javadoc and/or documentation for configuring
              a "JDBCTxDataSource".
              This problem is specific to non-XA resources in general, not JMS (which is an XA resource),
              you may wish to get more info by posting to the transaction newsgroup.
              Tom
              Manoj Bansal wrote:
              > using a container managed transactions can we achieve sending a message to the JMS
              > queue and updating DB as part of single transaction with the data base driver not
              > supporting XA. If yes what all configurations setting I need to do. I tried to achieve
              > this using 2PC but I am getting the error that "javax.transaction.xa.XAException:
              > JDBC driver does not support XA, hence cannot be a participant in two-phase commit.
              > To force this participation, set the enableTwoPhaseCommit property on the corresponding
              > JDBCTxDataSourceproperty, to true. Pool = ejbPool".
              

  • Authentication problem w MDB on WL8.1 and JMS Queue on WL6.1

              Hi,
              I'm having problems with a MessageDrivenBean that is deployed on a Weblogic 8.1
              server. It listens to a JMS Queue on a Weblogic 6.1 server.
              I'm getting the following error message upon deployment:
              [java.lang.SecurityException: Authentication for user system denied in realm wl_realm
              I've made sure that both servers are installed with the user "system" and a password
              of "password".
              This worked fine for two WL6.1 servers.
              Here's my ejb-jar.xml:
              <!DOCTYPE ejb-jar PUBLIC
              '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'
              'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
              <ejb-jar>
                  <enterprise-beans>
                      <message-driven>
                          <ejb-name>WebResponseJMSBean</ejb-name>
                          <ejb-class>com.ditech.webresponse.jms.WebResponseJMSBean</ejb-class>
                          <transaction-type>Container</transaction-type>
                          <message-driven-destination>
                              <destination-type>javax.jms.Queue</destination-type>
                          </message-driven-destination>
                      </message-driven>
                  </enterprise-beans>
                  <assembly-descriptor>
                      <container-transaction>
                          <description>Transaction attributes for 'WebResponseJMSBean' methods</description>
                          <method>
                              <ejb-name>WebResponseJMSBean</ejb-name>
                              <method-name>*</method-name>
                          </method>
                          <trans-attribute>NotSupported</trans-attribute>
                      </container-transaction>
                  </assembly-descriptor>
              </ejb-jar>
              Here's my weblogic-ejb-jar.xml:
              <?xml version="1.0"?>
              <!DOCTYPE weblogic-ejb-jar PUBLIC
              '-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN'
              'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
              <weblogic-ejb-jar>
                  <weblogic-enterprise-bean>
                      <ejb-name>WebResponseJMSBean</ejb-name>
                      <message-driven-descriptor>
                          <destination-jndi-name>com.ditech.jms.CowResponseQueue</destination-jndi-name>
                          <provider-url>t3://localhost:7003</provider-url>
                          <connection-factory-jndi-name>com.ptp.jms.AppOnlineConnectionFactory</connection-factory-jndi-name>
                      </message-driven-descriptor>
                      <jndi-name>ejb/WebResponseJMSBean</jndi-name>
                  </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              Can anyone give me any suggestions?
              Thanks in advance,
              -Ben
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 

              We are facing a similar issue, between MDB's and JMS Queues on 2 separated WebLogic
              8.1 domains. What I will test next week are:
              1. In the domain where my MDB's are deployed, configure Foreign JMS Servers/Connection
              Factories/Queues, for which passwords can be specified (not possible in weblogic-ejb-jar.xml)
              2. If No.1 does not work, I will add CredentialGenerated="false" in <SecurityConfiguration>
              in config.xml in both domains
              3. If No. 2 still does not work, I will specify run-as principal and security-role
              in my MDB DD files, and specify CredentialMapping via the WebLogic admin console.
              Maybe you can try the same?
              Eric Ma
              "B Liu" <[email protected]> wrote:
              >
              >Hi,
              >
              >I'm having problems with a MessageDrivenBean that is deployed on a Weblogic
              >8.1
              >server. It listens to a JMS Queue on a Weblogic 6.1 server.
              >
              >I'm getting the following error message upon deployment:
              >
              >[java.lang.SecurityException: Authentication for user system denied in
              >realm wl_realm
              >
              >I've made sure that both servers are installed with the user "system"
              >and a password
              >of "password".
              >
              >This worked fine for two WL6.1 servers.
              >
              >Here's my ejb-jar.xml:
              >
              ><!DOCTYPE ejb-jar PUBLIC
              >
              >'-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'
              >
              >'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
              >
              >
              ><ejb-jar>
              >
              >    <enterprise-beans>
              >
              >        <message-driven>
              >
              >            <ejb-name>WebResponseJMSBean</ejb-name>
              >            <ejb-class>com.ditech.webresponse.jms.WebResponseJMSBean</ejb-class>
              >            <transaction-type>Container</transaction-type>
              >            <message-driven-destination>
              >                <destination-type>javax.jms.Queue</destination-type>
              >            </message-driven-destination>
              >
              >        </message-driven>
              >
              >    </enterprise-beans>
              >
              >    <assembly-descriptor>
              >
              >        <container-transaction>
              >
              >            <description>Transaction attributes for 'WebResponseJMSBean'
              >methods</description>
              >            <method>
              >                <ejb-name>WebResponseJMSBean</ejb-name>
              >                <method-name>*</method-name>
              >            </method>
              >            <trans-attribute>NotSupported</trans-attribute>
              >
              >        </container-transaction>
              >
              >    </assembly-descriptor>
              >
              ></ejb-jar>
              >
              >Here's my weblogic-ejb-jar.xml:
              >
              ><?xml version="1.0"?>
              >
              >
              >
              ><!DOCTYPE weblogic-ejb-jar PUBLIC
              >
              >'-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN'
              >
              >'http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd'>
              >
              >
              ><weblogic-ejb-jar>
              >
              >    <weblogic-enterprise-bean>
              >
              >        <ejb-name>WebResponseJMSBean</ejb-name>
              >
              >        <message-driven-descriptor>
              >
              >            <destination-jndi-name>com.ditech.jms.CowResponseQueue</destination-jndi-name>
              >            <provider-url>t3://localhost:7003</provider-url>
              >            <connection-factory-jndi-name>com.ptp.jms.AppOnlineConnectionFactory</connection-factory-jndi-name>
              >        </message-driven-descriptor>
              >
              >        <jndi-name>ejb/WebResponseJMSBean</jndi-name>
              >
              >    </weblogic-enterprise-bean>
              >
              ></weblogic-ejb-jar>
              >
              >
              >Can anyone give me any suggestions?
              >
              >Thanks in advance,
              >-Ben
              >
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

  • Injecting JMS Queue / Destination into MDB fails

    I am trying to inject a Destination into an EJB3 MDB using
        @Resource(name = "queue/abc/Responses")
        private Destination m_responseQueue;In the ejb-jar.xml file I declare the following
          <message-driven>
                <ejb-name>JobRequestListener</ejb-name>
                <ejb-class>com.abc.backend.jobs.JobRequestListener</ejb-class>
                <message-destination-link>JobRequests</message-destination-link>
                <!--Inherited From AbstractManagedBean -->
                <resource-ref>
                    <res-ref-name>jms/ConnectionFactory</res-ref-name>
                    <res-type>javax.jms.ConnectionFactory</res-type>
                    <res-auth>Container</res-auth>
                </resource-ref>
                <!--Local Resources -->
                <message-destination-ref>
                    <message-destination-ref-name>queue/abc/Responses</message-destination-ref-name>
                    <message-destination-type>javax.jms.Queue</message-destination-type>
                    <message-destination-usage>Produces</message-destination-usage>
                    <message-destination-link>Responses</message-destination-link>
                </message-destination-ref>
            </message-driven>and in weblogic-ejb-jar.xml I add
        <weblogic-enterprise-bean>
            <ejb-name>JobRequestListener</ejb-name>
            <message-driven-descriptor>
                <pool>
                    <max-beans-in-free-pool>20</max-beans-in-free-pool>
                    <initial-beans-in-free-pool>10</initial-beans-in-free-pool>
                </pool>
                <destination-jndi-name>queue/abc/JobRequests</destination-jndi-name>
            </message-driven-descriptor>
            <transaction-descriptor>
                <trans-timeout-seconds>315</trans-timeout-seconds>
            </transaction-descriptor>
            <!--Inherited From AbstractManagedBean -->
            <resource-description>
                <res-ref-name>jms/ConnectionFactory</res-ref-name>
                <jndi-name>jms/ABCConnectionFactory</jndi-name>
            </resource-description>
            <!--Local Resources -->        
            <resource-description>
                <res-ref-name>queue/abc/Responses</res-ref-name>
                <jndi-name>queue/abc/Responses</jndi-name>
            </resource-description>
        </weblogic-enterprise-bean>Initially I didn't have the resource-description in the weblogic-ejb-jar.xml file, but even after adding it I am still getting the following exception during deployment
    [EJB:011026]The EJB container failed while creating the java:/comp/env namespace for
    this EJB deployment. weblogic.deployment.EnvironmentException:
    [EJB:010176]The resource-env-ref 'queue/abc/Responses' declared in the ejb-jar.xml
    descriptor or annotation has no JNDI name mapped to it. The resource-ref must
    be mapped to a JNDI name using the resource-description element of the
    weblogic-ejb-jar.xml descriptor or corresponding annotation.
         at weblogic.ejb.container.deployer.EnvironmentBuilder.addResourceEnvReferences(EnvironmentBuilder.java:639)
         at weblogic.ejb.container.deployer.EJBDeployer.setupEnvironmentContext(EJBDeployer.java:247)
         at weblogic.ejb.container.deployer.EJBDeployer.setupEnvironmentFor(EJBDeployer.java:1014)
         at weblogic.ejb.container.deployer.EJBDeployer.setupBeanInfos(EJBDeployer.java:908)
         at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1188)
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:425)By injecting a Queue rather then a destination I can work around this issue, however I would prefer to use a Destination as this allows me to change the behavior of my application without making code changes. It seems like a bug in 10.3 to me.
    Edited by: ejb3workshop on Sep 1, 2009 1:44 PM
    Edited by: ejb3workshop on Sep 1, 2009 1:59 PM
    Edited by: ejb3workshop on Sep 2, 2009 3:11 PM

    Because JMS resources by the very nature are "undependable", I think it is usually not advisable to inject JMS resources into an EJB except for MDB source destinations. The problem with injection of JMS resources is that if the JMS resource is not available at the point the EJB is originally deployed/initialized, the EJB deployment/initializaition will fail (except for MDBs, which will still deploy if the source is down, and will automatically retry internally). This is goodness for many types of resources, but since JMS resources are not necessarily always available by their very nature (down for maintenance, in the middle of a migration, initializing later in the boot, etc), most messaging applications should be specifically designed to be robustly handle the failure case during runtime.
    Anyhow, EJB3 does not require descriptors.
    I haven't fully vetted the following samples, but I think they should be pretty close to correct.
    Sample MDB code:
    // MDB will still deploy even if the source destination is down (the container will keep retrying internally).
    @MessageDriven(mappedName = "Server1Q1",
                            activationConfig = {@ActivationConfigProperty(
                                                          propertyName = "connectionFactoryJndiName",
                                                          propertyValue = "Server1CF")})
    public class MyMDB implements MessageListener {
      @EJB
      private MyStateless myStateless;
      @TransactionAttribute(TransactionAttributeType.REQUIRED)
      public void onMessage(Message message) {
        System.out.println("Got the message, version 5: "+message);
        myStateless.completeWorkOrder();
    Sample injected JMS resources - no resource descriptors needed:
    @Stateless(mappedName="StatelessBean")
    public class MyStatelessBean implements MyStateless {
      int ctr;
      @Resource(mappedName="mdbq2")
      private Queue queue1;
      @Resource(mappedName="cfadmin2")
      private QueueConnectionFactory connectionFactory2;
    Sample pseudo-code for non-injected JMS resources, no resource descriptors needed:
    Eg, instead of
    @Resource(mappedName="cfadmin")
    private QueueConnectionFactory cf;
    Do this:
      // note the semi-colon!  turns off injection, note the type field -- required
      // I'm not sure of exact syntax
      //cfadmin is assumed to be the JNDI name if the
      // JNDI name isn't specified in another parameter... 
      @Resource(mappedName="cfadmin", type="javax.jms.QueueConnectionFactory");  
      // this is not injected now
      // cache cf for re-use (performance)
      private QueueConnectionFactory cf;
      @Resource
      private SessionContext sctx;  // inject the session ctx
    And in the source code itself, do this:
       int tryCount == 3; 
       while (cf != null) {
         try { 
           // not quite sure if this is the righ syntax, but I think "java:/comp/env" prefix
           // isn't needed for the new EJB3.0 session context
           cf = sctx.lookup("cfadmin");  //cfadmin is mappedname for resource above
         } catch (NNN n) {  // don't know the exact exception
           if (--tryCount == 0) throw n;
           sleep 3 seconds  // don't want to retry in a tight loop
    Tom

  • MDB on Tibco JMS Queue

    Hy, I'm writing about a technical problem with BeaWebLogicServer 6.1 sp5.
    I've a MessageDrivenBean in the BeaWebLogic Container that must be connected to
    a remote Tibco JMS queue.
    When the remote Tibco queue is not protected by a password this works fine (my
    MDB receives the message from Tibco queue), instead if the remote queue is password
    protected, i've this Bea Weblogic server error log:
    <Jun 18, 2004 3:06:06 PM CEST> <Warning> <EJB> <The Message-Driven EJB: BuyResponseConsumer
    is unable to connect to the JMS destination: TELECOMIT.IPBILLING.SVIL.PI.PORTALE.ORDER.BUYRESP.
    Connection failed after 850 attempts. The MDB will attempt to reconnect every
    10 seconds, this log message will repeat every 600 seconds until the condition
    clears.>
    How may I resolve this problem?
    These are my xml descriptors:
    EJB-JAR.XML:
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
    2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <message-driven>
    <ejb-name>BuyResponseConsumer</ejb-name> <ejb-class>it.telecomitalia.wonderland.ipbilling.buyresponse.BuyResponseConsumer</ejb-class>
    <transaction-type>Container</transaction-type> <acknowledge-mode>auto-acknowledge</acknowledge-mode>
    <message-driven-destination> <destination-type>javax.jms.Queue</destination-type>
    </message-driven-destination>
    <security-identity>
    <use-caller-identity id="XXXXX" />
    </security-identity>
    </message-driven>
    </enterprise-beans>
    <assembly-descriptor>
    <security-role>
    <role-name>XXXXX</role-name>
    </security-role>
    </assembly-descriptor>
    </ejb-jar>
    WEBLOGIC-EJB-JAR.XML
    <?xml version="1.0"?> <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD
    WebLogic 6.0.0 EJB//EN" "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd">
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean> <ejb-name>BuyResponseConsumer</ejb-name> <message-driven-descriptor>
    <pool>
    <max-beans-in-free-pool>200</max-beans-in-free-pool> <initial-beans-in-free-pool>20</initial-beans-in-free-pool>
    </pool> <destination-jndi-name>REMOTE-MESSAGE-QUEUE-NAME</destination-jndi-name>
    <initial-context-factory>com.tibco.tibjms.naming.TibjmsInitialContextFactory</initial-context-factory>
    <provider-url>tcp://XXX.XXX.XXX.XXX:YYY</provider-url> <connection-factory-jndi-name>QueueConnectionFactory</connection-factory-jndi-name>
    </message-driven-descriptor> <jndi-name>BuyResponseConsumer</jndi-name> </weblogic-enterprise-bean>
    <security-role-assignment>
    <role-name>XXXXX</role-name> <principal-name>XXXXX</principal-name> </security-role-assignment>
    </weblogic-ejb-jar>
    Thanks in advance,
    Best Regards
    Demis Gallisto

    Hy, I'm writing about a technical problem with BeaWebLogicServer 6.1 sp5.
    I've a MessageDrivenBean in the BeaWebLogic Container that must be connected to
    a remote Tibco JMS queue.
    When the remote Tibco queue is not protected by a password this works fine (my
    MDB receives the message from Tibco queue), instead if the remote queue is password
    protected, i've this Bea Weblogic server error log:
    <Jun 18, 2004 3:06:06 PM CEST> <Warning> <EJB> <The Message-Driven EJB: BuyResponseConsumer
    is unable to connect to the JMS destination: TELECOMIT.IPBILLING.SVIL.PI.PORTALE.ORDER.BUYRESP.
    Connection failed after 850 attempts. The MDB will attempt to reconnect every
    10 seconds, this log message will repeat every 600 seconds until the condition
    clears.>
    How may I resolve this problem?
    These are my xml descriptors:
    EJB-JAR.XML:
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
    2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <message-driven>
    <ejb-name>BuyResponseConsumer</ejb-name> <ejb-class>it.telecomitalia.wonderland.ipbilling.buyresponse.BuyResponseConsumer</ejb-class>
    <transaction-type>Container</transaction-type> <acknowledge-mode>auto-acknowledge</acknowledge-mode>
    <message-driven-destination> <destination-type>javax.jms.Queue</destination-type>
    </message-driven-destination>
    <security-identity>
    <use-caller-identity id="XXXXX" />
    </security-identity>
    </message-driven>
    </enterprise-beans>
    <assembly-descriptor>
    <security-role>
    <role-name>XXXXX</role-name>
    </security-role>
    </assembly-descriptor>
    </ejb-jar>
    WEBLOGIC-EJB-JAR.XML
    <?xml version="1.0"?> <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD
    WebLogic 6.0.0 EJB//EN" "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd">
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean> <ejb-name>BuyResponseConsumer</ejb-name> <message-driven-descriptor>
    <pool>
    <max-beans-in-free-pool>200</max-beans-in-free-pool> <initial-beans-in-free-pool>20</initial-beans-in-free-pool>
    </pool> <destination-jndi-name>REMOTE-MESSAGE-QUEUE-NAME</destination-jndi-name>
    <initial-context-factory>com.tibco.tibjms.naming.TibjmsInitialContextFactory</initial-context-factory>
    <provider-url>tcp://XXX.XXX.XXX.XXX:YYY</provider-url> <connection-factory-jndi-name>QueueConnectionFactory</connection-factory-jndi-name>
    </message-driven-descriptor> <jndi-name>BuyResponseConsumer</jndi-name> </weblogic-enterprise-bean>
    <security-role-assignment>
    <role-name>XXXXX</role-name> <principal-name>XXXXX</principal-name> </security-role-assignment>
    </weblogic-ejb-jar>
    Thanks in advance,
    Best Regards
    Demis Gallisto

  • Issue with MDB (jms Queue) in weblogic 8.1

              Hi all...
              I'm facing a strange kind of problem with MDB using weblogic 8.1.
              The code worked perfectly in weblogic 7.0.
              This is wht i'm trying to achieve..
              i'm having a MDB which implements a onMessage().
              I'm publishing message thru a standalone client. Publishing works fine..
              The problem is onMessage(javax.jms.Message msg) is never been called :-(.
              when i monitor it shows that messages are recieved..
              Am is missing something that is really important..
              here is my code
              package com.csxwt.zodiac.service.domain;
              import javax.ejb.*;
              import javax.jms.*;
              import javax.naming.*;
              import java.io.Serializable;
              //import com.csxwt.zodiac.service.domain.TestObject;
              public class MDBTestBean implements MessageDrivenBean, MessageListener {
              MessageDrivenContext messageDrivenContext;
              public void ejbCreate() throws CreateException {
              System.out.println("into the ejb create");
              /**@todo Complete this method*/
              public void ejbRemove() {
              /**@todo Complete this method*/
              public void onMessage(javax.jms.Message msg) {
              System.out.println("into the onMessage method 1 ");
              ObjectMessage objectMsg = null;
              String strObject = "Test";
              try
              System.out.println("into the onMessage method 2 ");
              if (msg instanceof ObjectMessage)
              System.out.println("into the onMessage method 3");
              objectMsg = (ObjectMessage) msg;
              Serializable serializableObj = objectMsg.getObject();
              String test = serializableObj.toString();
              System.out.println("value of the message sent " + test);
              TestObject test1 = null;
              if(serializableObj instanceof TestObject )
              test1 = (TestObject) serializableObj;
              System.out.println("after getting the test value ");
              System.out.println("getting the test object valuye " + test1.getName());
              else
              return;
              catch (Exception e)
              System.out.println("Message Bean:unexpected Exception thrown ");
              e.printStackTrace();
              public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext)
              System.out.println("into MDB context");
              this.messageDrivenContext = messageDrivenContext;
              here are the 2 xml files....
              <ejb-jar>
              <enterprise-beans>
              <message-driven>
              <display-name>MDBTest</display-name>
              <ejb-name>MDBTest</ejb-name>
              <ejb-class>com.csxwt.zodiac.service.domain.MDBTestBean</ejb-class>
              <transaction-type>Container</transaction-type>
              <message-selector>GATE_LANE</message-selector>
              <message-driven-destination>
              <destination-type>javax.jms.Queue</destination-type>
              </message-driven-destination>
              </message-driven>
              </enterprise-beans>
              <assembly-descriptor>
              <container-transaction>
              <method>
              <ejb-name>MDBTest</ejb-name>
              <method-name>*</method-name>
              </method>
              <trans-attribute>Required</trans-attribute>
              </container-transaction>
              </assembly-descriptor>
              </ejb-jar>
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>MDBTest</ejb-name>
              <message-driven-descriptor>
              <pool>
              <max-beans-in-free-pool>200</max-beans-in-free-pool>
              <initial-beans-in-free-pool>20</initial-beans-in-free-pool>
              </pool>
              <destination-jndi-name>zodiac.jms.queue.HardWareOutMessageQueue</destination-jndi-name>
              </message-driven-descriptor>
              </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              Am i missing something somewhere?????
              any help in this is highly appreciated..
              thanks in advance.
              r
              sasi
              

    Check your log for error and warning messages. If there
              are some, they should help trace down the problem. If there
              aren't any, try confirm that your MDB is deploying in
              the first place.
              The MDB below is a Q MDB, but you write below that your client
              is a "publisher". "Publisher" implies a topic producer, not
              a queue producer, and topic producer can't publish to queues.
              Tom
              T. Sasii Dharma wrote:
              > Hi all...
              >
              > I'm facing a strange kind of problem with MDB using weblogic 8.1.
              > The code worked perfectly in weblogic 7.0.
              > This is wht i'm trying to achieve..
              > i'm having a MDB which implements a onMessage().
              > I'm publishing message thru a standalone client. Publishing works fine..
              > The problem is onMessage(javax.jms.Message msg) is never been called :-(.
              > when i monitor it shows that messages are recieved..
              > Am is missing something that is really important..
              >
              > here is my code
              >
              > package com.csxwt.zodiac.service.domain;
              >
              > import javax.ejb.*;
              > import javax.jms.*;
              > import javax.naming.*;
              > import java.io.Serializable;
              > //import com.csxwt.zodiac.service.domain.TestObject;
              >
              > public class MDBTestBean implements MessageDrivenBean, MessageListener {
              > MessageDrivenContext messageDrivenContext;
              > public void ejbCreate() throws CreateException {
              > System.out.println("into the ejb create");
              > /**@todo Complete this method*/
              > }
              > public void ejbRemove() {
              > /**@todo Complete this method*/
              > }
              > public void onMessage(javax.jms.Message msg) {
              > System.out.println("into the onMessage method 1 ");
              > ObjectMessage objectMsg = null;
              > String strObject = "Test";
              > try
              > {
              > System.out.println("into the onMessage method 2 ");
              > if (msg instanceof ObjectMessage)
              > {
              > System.out.println("into the onMessage method 3");
              > objectMsg = (ObjectMessage) msg;
              > Serializable serializableObj = objectMsg.getObject();
              > String test = serializableObj.toString();
              > System.out.println("value of the message sent " + test);
              > TestObject test1 = null;
              > if(serializableObj instanceof TestObject )
              > {
              > test1 = (TestObject) serializableObj;
              > System.out.println("after getting the test value ");
              > System.out.println("getting the test object valuye " + test1.getName());
              > }
              >
              > }
              > else
              > {
              > return;
              > }
              >
              > }
              > catch (Exception e)
              > {
              > System.out.println("Message Bean:unexpected Exception thrown ");
              > e.printStackTrace();
              > }
              >
              > }
              > public void setMessageDrivenContext(MessageDrivenContext messageDrivenContext)
              > {
              > System.out.println("into MDB context");
              >
              > this.messageDrivenContext = messageDrivenContext;
              > }
              > }
              >
              >
              > here are the 2 xml files....
              >
              > <ejb-jar>
              > <enterprise-beans>
              > <message-driven>
              > <display-name>MDBTest</display-name>
              > <ejb-name>MDBTest</ejb-name>
              > <ejb-class>com.csxwt.zodiac.service.domain.MDBTestBean</ejb-class>
              > <transaction-type>Container</transaction-type>
              > <message-selector>GATE_LANE</message-selector>
              > <message-driven-destination>
              > <destination-type>javax.jms.Queue</destination-type>
              > </message-driven-destination>
              > </message-driven>
              > </enterprise-beans>
              > <assembly-descriptor>
              > <container-transaction>
              > <method>
              > <ejb-name>MDBTest</ejb-name>
              > <method-name>*</method-name>
              > </method>
              > <trans-attribute>Required</trans-attribute>
              > </container-transaction>
              > </assembly-descriptor>
              > </ejb-jar>
              >
              > <weblogic-ejb-jar>
              > <weblogic-enterprise-bean>
              > <ejb-name>MDBTest</ejb-name>
              > <message-driven-descriptor>
              > <pool>
              > <max-beans-in-free-pool>200</max-beans-in-free-pool>
              > <initial-beans-in-free-pool>20</initial-beans-in-free-pool>
              > </pool>
              > <destination-jndi-name>zodiac.jms.queue.HardWareOutMessageQueue</destination-jndi-name>
              > </message-driven-descriptor>
              > </weblogic-enterprise-bean>
              > </weblogic-ejb-jar>
              >
              > Am i missing something somewhere?????
              > any help in this is highly appreciated..
              >
              > thanks in advance.
              >
              > r
              > sasi
              

  • Stop MDB from listening to a JMS queue

    Hello,
    From time to time we would like to stop the processing done in our application.
    The processing is started by onMessage() in MDB. Is it possible to tell the MDB
    to stop listening
    to the JMS queue or stop the delivery of messages by JMS ? We do not intent to
    stop the processing of messages that have already started by only to stop processing
    of further messages (the ones still in the JMS queue).
    We are using 6.1SP3.
    Any help is appreciated.
    Eric Poupaert,
    Approach Belgium SA.

    If you can tune the number of messages that should be sent to the MDB to 0, that would
    temporarily stop the MDB from consuming messages. Thsi is the "Messages maximum"
    parameter on ur connectionfactory. WL6 doesnt support changing this value to 0 but there
    were some newsgroup discussions last year that it might be supported in a future
    release. Maybe its fixed in 8?
    Eric Poupaert wrote:
    Hello,
    From time to time we would like to stop the processing done in our application.
    The processing is started by onMessage() in MDB. Is it possible to tell the MDB
    to stop listening
    to the JMS queue or stop the delivery of messages by JMS ? We do not intent to
    stop the processing of messages that have already started by only to stop processing
    of further messages (the ones still in the JMS queue).
    We are using 6.1SP3.
    Any help is appreciated.
    Eric Poupaert,
    Approach Belgium SA.

  • Sending message to a JMS queue and making DB update through a single container managed transaction

    Can we use container managed transactions to send message to JMS queue and make DB updates in a sigle transaction. If yes then do we need 2pC license. I am using weblogic 6.0 SP2 and my database driver do not supports XA

    If your JMS provider is XA compliant, you can.
    If you are using WebLogic 6.0 JMS, it supports 2PC.
    The JDBC resource that does not support XA can participate in the global transaction
    creating a TXDataSource and setting "enable two-phase commit"=true in the Configuration
    panel.
    About the JMSConnectionFactory, on the console, in WebLogic 6.0, in the "Transaction"
    tab folder, set "User Transactions Enabled"=true.
    In your code, use non-transacted sessions.
    For 2pc protocol, you need a license or you'll get an exception.
    Sergi
    Manoj Bansal <[email protected]> wrote:
    Can we use container managed transactions to send message to JMS queue and
    make DB updates in a sigle transaction. If yes then do we need 2pC license.
    I am using weblogic 6.0 SP2 and my database driver do not supports XA

Maybe you are looking for