AQ & MDB on WLS

          Hi,
          I am binding the AQ_QF & AQ_Q to the JNDI tree of WLS using a startup class and
          polling on the queue using an MDB. (I have used Eric Ma's code as an example.)
          But, the problem is that MDB polls on the queue only "during" starting of WLS
          or when the MDB is being re-deployed. After, starting WLS the MDB fails to read
          messages from the AQ unless redeployed. I have checked the JNDI tree using WLS
          console. The AQ_QF & AQ_Q are bound to the tree correctly. The polling interval
          of the MDB is set to 1 sec.
          Can anyone give pointers to why the MDB is not polling on the AQ ?
          Please note the any other JMS receiver is able lookup the QF & Q and read messages
          from the AQ after startup.
          Regards,
          Diptanshu
          

Diptanshu,
          Since I changed my consumer from a POJO to an MDB I'm experiencing the same problem. Can you give me some pointers on how to solve this issue?
          Thanks in advance
          R

Similar Messages

  • A startup class to enable MQ Queues to trigger MDBs in WLS 6.1(sp4)

              Hi,
              I am hoping for references to documentation or opinions on the following method
              allowing the use of MQ queues to drive MDBs in WLS. The technique involves rebinding
              the connection factory in jndi at "weblogic.jms.MessageDrivenBeanConnectionFactory"
              with MQs connection factory.
              I read in various newsgroup posts that replacing WLS' ConnectionFactory with MQ's
              in a startup class will not allow MDBs to be linked to an MQ queue because startup
              classes are run after MDB deployment during startup. However I found some unused
              in-house code which appeared to do just that and it works.
              Here is the code in abbreviated form:
              public String startup(String str, Hashtable args) throws Exception
                   bindMQFactory();
                   bindMQQueues();
                   return "";
              private void bindMQFactory() throws Exception
                   // Create MQ Factory and configure it
                   MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
                   factory.setChannel(channel );
                   factory.setHostName(host);
                   factory.setPort(Integer.parseInt(port));
                   factory.setQueueManager(qmanager);
                   factory.setTransportType( JMSC.MQJMS_TP_CLIENT_MQ_TCPIP );
                   // bind connection factory into WLS JNDI for later use by clients
                   _wlsContext.bind( connectionFactoryJndi, factory );
                   // Force mq connection factory to be the one used for mdb's
                   _wlsContext.rebind("weblogic.jms.MessageDrivenBeanConnectionFactory", factory);
              private void bindMQQueue() throws Exception
                   // create queue and configure it
                   MQQueue queue = new MQQueue();
                   queue.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ );
                   queue.setBaseQueueName( mqQueueName );
                   // bind queue in WLS JNDI
                   _wlsContext.bind( wlsJndi, queue );
              Thanks in advance for any comments or opinions on the above.
              regards
              Martin
              

    Start with the white-paper:
              "Using Foreign JMS Providers with WebLogic Server"
              Note that to get transactional behavior you
              will need to use the WebLogic Messaging Bridge feature.
              Note that integrating MQ is easier in 8.1 - consider
              using WL 8.1 if you can.
              One more comment in-line.
              Martin wrote:
              > Hi,
              >
              > I am hoping for references to documentation or opinions on the following method
              > allowing the use of MQ queues to drive MDBs in WLS. The technique involves rebinding
              > the connection factory in jndi at "weblogic.jms.MessageDrivenBeanConnectionFactory"
              > with MQs connection factory.
              Not recommended. Highly not recommended. Do not use the same name
              as the internal factory. Create your own name for a CF, and change the
              weblogic ejb jar to reference your name. The above white-paper
              states how to do this.
              >
              > I read in various newsgroup posts that replacing WLS' ConnectionFactory with MQ's
              > in a startup class will not allow MDBs to be linked to an MQ queue because startup
              > classes are run after MDB deployment during startup. However I found some unused
              > in-house code which appeared to do just that and it works.
              >
              > Here is the code in abbreviated form:
              > public String startup(String str, Hashtable args) throws Exception
              > {
              >      bindMQFactory();
              >      bindMQQueues();
              >
              >      return "";
              > }
              >
              > private void bindMQFactory() throws Exception
              > {
              >
              >      // Create MQ Factory and configure it
              >      MQQueueConnectionFactory factory = new MQQueueConnectionFactory();
              >      factory.setChannel(channel );
              >      factory.setHostName(host);
              >      factory.setPort(Integer.parseInt(port));
              >      factory.setQueueManager(qmanager);
              >      factory.setTransportType( JMSC.MQJMS_TP_CLIENT_MQ_TCPIP );
              >
              >      // bind connection factory into WLS JNDI for later use by clients
              >      _wlsContext.bind( connectionFactoryJndi, factory );
              >
              >      // Force mq connection factory to be the one used for mdb's
              >      _wlsContext.rebind("weblogic.jms.MessageDrivenBeanConnectionFactory", factory);
              > }
              >
              > private void bindMQQueue() throws Exception
              > {
              >      // create queue and configure it
              >      MQQueue queue = new MQQueue();
              >      queue.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ );
              >      queue.setBaseQueueName( mqQueueName );
              >
              >      // bind queue in WLS JNDI
              >      _wlsContext.bind( wlsJndi, queue );
              > }
              >
              > Thanks in advance for any comments or opinions on the above.
              >
              > regards
              >
              > Martin
              

  • MDB/Topic/WLS cluster question

              Hi
              I was going through some WLS 8.1 docs on JMS and had a question abt Topics & WLS
              in cluster config where say I have 3 servers with say server#1 hosting the Topic
              [not a distributed destination]. I have an an ear file containing an MDB with
              no pool size limit. After deploying the ear in the cluster - lets say that each
              server on the cluster has 5 instances of the MDB [just an example] and a message
              is published on the Topic.
              Q1>Will all the 3 servers get a [one and only one] copy of that message? [my guess
              is yes]
              Q2>Only 1 instance [out of 5] of the MDB/per server will get the message - right?
              Q3> Had I had a separate deployment of the same MDB class in the EAR file for
              the same Topic - thats just going to get treated as a completely separate subscriber
              independent of the first MDB though the implementing class is the same - right?
              thanks
              Anamitra
              

              Anamitra wrote:
              > Hi
              > I was going through some WLS 8.1 docs on JMS and had a question abt Topics & WLS
              > in cluster config where say I have 3 servers with say server#1 hosting the Topic
              > [not a distributed destination]. I have an an ear file containing an MDB with
              > no pool size limit. After deploying the ear in the cluster - lets say that each
              > server on the cluster has 5 instances of the MDB [just an example] and a message
              > is published on the Topic.
              >
              > Q1>Will all the 3 servers get a [one and only one] copy of that message? [my guess
              > is yes]
              Yes.
              > Q2>Only 1 instance [out of 5] of the MDB/per server will get the message - right?
              Yes.
              > Q3> Had I had a separate deployment of the same MDB class in the EAR file for
              > the same Topic - thats just going to get treated as a completely separate subscriber
              > independent of the first MDB though the implementing class is the same - right?
              Yes.
              >
              > thanks
              > Anamitra
              >
              For a little more information, I'm attaching notes on durable
              subscriber MDBs.
              A JMS durable subscription is uniquely identified within a cluster by a combination of "connection-id" and "subscription-id". Only one active connection may use a particular "connection-id" within a WebLogic cluster.
              In WebLogic 8.1 and previous, a durable topic subscriber MDB uses its name to generate its client-id. Since JMS enforces uniqueness on this client-id, this means that if a durable subscriber MDB is deployed to multiple servers only one server will be able to connect. Some applications want a different behavior where
              each MDB pool on each server gets its own durable subscription.
              The MDB connection id, which is unique within a cluster, comes from:
              1) The "ClientId" attribute configured on the WebLogic connection factory.
              This defaults to null. Note that if the ClientId is set on a connection
              factory, only one connection created by the factory
              may be active at a time.
              2) If (1) is not set, then, as with the subscriber-id,
              the connection-id is derived from jms-client-id descriptor attribute:
              <jms-client-id>MyClientID</jms-client-id>
              (the weblogic dtd)
              3) If (1) and (2) are not set, then, as with the subscriber-id,
              the connection-id is derived from the ejb name.
              The MDB durable subscription id, which must be unique on its topic, comes from:
              1) <jms-client-id>MyClientID</jms-client-id>
              (the weblogic dtd)
              2) if (1) is not set then the client-id
              comes from the ejb name.
              The above prevents a durable topic subscriber MDB from running on multiple servers. When an instance of the MDB starts on another server, it deploys successfully, but a conflict is detected and the MDB fails to fully connect to JMS. The work-around is the following:
              A) Create a custom connection-factory for each server:
              1) configure "JNDIName" to the same value across all servers
              ("myMDBCF" in this example)
              2) configure "ClientId" to a unique value per server
              3) enable "UserTransactionsEnabled"
              4) enable "XAConnectionFactoryEnabled"
              5) set "AcknowledgePolicy" to "ACKNOWLEDGE_PREVIOUS"
              6) target the CF at a single WebLogic server
              (Number 5 is required for non-transactional topic MDBs)
              B) In the MDB's weblogic-ejb-jar.xml descriptor, set the MDB's connection
              factory to the JNDI name of the custom connection factories configured in
              (A). Optionally, also specify the subscriber-id via the jms-client-id
              attribute.
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>exampleBean</ejb-name>
              <message-driven-descriptor>
              <connection-factory-jndi-name>myMDBCF</connection-factory-jndi-name>
              <jms-client-id>myClientID</jms-client-id>
              </message-driven-descriptor>
              </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              C) Target the application at the same servers that have the custom connection
              factories targeted at them.
              Notes/Limitations:
              1) If the MDB is moved from one server to another, the MDB's corresponding
              connection-factory must be moved with it.
              2) This work-around will not work if the destination is not in the same
              cluster as the MDB. (The MDB can not use the local connection factory, which
              contains the connection-id, as connection factories do not work unless they
              are in the same cluster as the destination.)
              3) This work-around will not work for non-WebLogic JMS topics.
              4) A copy of each message is sent to each to each server's MDB pool.
              

  • Custom authorization for MDB in WLS 7.0

    Hi,
    Does anyone know how to authorize MDB using a Custom Authorization
    Provider while the Weblogic Container registers the MDB as a listener
    to JMS queue? My Custom Authorization Provider uses an oracle database
    to store user roles and access control lists to allow a certain role
    to access specific weblogic resources.
    Any assistance is highly appreciated.
    Thanks
    Siva

    The main reason is that JMS topics do not work well with HTTP clients. A topic cannot
    initiate an HTTP call to the subscriber, so we have to store the message in memory
    outside of JMS waiting for the subscriber to call us. Reliability is lost (if anyone
    cared). The lifecycle of the outbound message is controled by the HTTP session timeout
    (yuck!). This did not look like a solid feature that we should support.
    If you like it, you can implement it yourself. I would recommend using JAX-RPC
    handlers for that.
    Thanks,
    -ruslan
    Michael Poulin wrote:
    The deprication note is in "Creating JMS-Implemented WebLogic Web Services, section
    Overview of JMS ...

  • MDB deployed on a separate WLS/machine from where JMS is running

    I'm trying to deploy an MDB on a separate WLS/machine from where
    JMS is running. How and where to put the reference to the queue to read messages.
    Also please share the versions of ejb-jar.xml and weblogic-ejb-jar.xml files that
    are more practical and meaningful than they are in BEA samples.
    Thanks a lot.

    If the MDB's WLS instance and the JMS WLS instance are in the same
    cluster, then you shouldn't need to do anything. (The clustering will
    present a unified JNDI tree and that's how it finds it.)
    If they're not clustered, you need something like this in your
    weblogic-ejb-jar.xml:
    <message-driven-descriptor>
    <destination-jndi-name>Bids</destination-jndi-name>
    <provider-url>t3://jms_server:7001</provider-url>
    </message-driven-descriptor>
    -- Rob
    Alan wrote:
    I'm trying to deploy an MDB on a separate WLS/machine from where
    JMS is running. How and where to put the reference to the queue to read messages.
    Also please share the versions of ejb-jar.xml and weblogic-ejb-jar.xml files that
    are more practical and meaningful than they are in BEA samples.
    Thanks a lot.

  • MDB messages dont get processed from Queues when involving a remote Topic in transaction

    Using WLS 6.1 SP4 on winXP Pro boxes, I have come across a peculiar problem:
              I have several MDBs that process ObjectMessages from queues and forward their payload (wrapped in another new ObjectMessage) to other queues, all of which are located within the same WLS server.
              Right now I'm adding a new MDB that gets messages from a remote Topic with a durable subscription, and forwards the payload to local queues after some processing.
              When the Topic is local as well, there is no problem. But when the Topic is set up in a remote machine, only the MDB that has the remote durable subscription works the way it should. It receives the remote message and forwards it to the corresponding local queue. But then the messages in those local queues dont get processed. The 'Messages Received' count rises and the 'Messages' count stays at 0, as if the messages had been correctly processed and acknowledged, but no onMessage() method is called besides the one from the MDB that has the durable subscription to the remote Topic (I can tell because there's no further processing from the queue those messages get put in). It's as if those messages were simply received and acknowledged without being passed to other MDBs by WLS.
              * All queue MDBs use Required container-managed transaction management and auto-acknowledge
              * All queue MDBs have default durability for their queue subscriptions
              * The topic MDB has a durable subscription stored in a filestore
              * Lookup of the remote Topic is done via JNDI
              Since the processing and forwarding of messages occurs the way it should when everything is local, I am inclined to believe one of two things:
              a) There's some issue with the way WLS treats messages (or even just payloads) when they come from a remote server
              b) WLS is doing something I'm not aware of when propagating a transaction that begins with the delivery of a message from a remote JMS Topic when it involves further forwarding of messages in local JMS Queues.
              Any help will be appreciated.
              regards,
              .munir estevane
              

    Is the durable subscriber forwarder rolling back its transactions?
              That would cause the behavior you describe (eg the message gets
              placed in the queue, but is never made visible). What do
              the pending counts on the destination queue look like?
              Munir Estevane wrote:
              > Using WLS 6.1 SP4 on winXP Pro boxes, I have come across a peculiar problem:
              >
              > I have several MDBs that process ObjectMessages from queues and forward their payload (wrapped in another new ObjectMessage) to other queues, all of which are located within the same WLS server.
              > Right now I'm adding a new MDB that gets messages from a remote Topic with a durable subscription, and forwards the payload to local queues after some processing.
              >
              > When the Topic is local as well, there is no problem. But when the Topic is set up in a remote machine, only the MDB that has the remote durable subscription works the way it should. It receives the remote message and forwards it to the corresponding local queue. But then the messages in those local queues dont get processed. The 'Messages Received' count rises and the 'Messages' count stays at 0, as if the messages had been correctly processed and acknowledged, but no onMessage() method is called besides the one from the MDB that has the durable subscription to the remote Topic (I can tell because there's no further processing from the queue those messages get put in). It's as if those messages were simply received and acknowledged without being passed to other MDBs by WLS.
              >
              > * All queue MDBs use Required container-managed transaction management and auto-acknowledge
              > * All queue MDBs have default durability for their queue subscriptions
              > * The topic MDB has a durable subscription stored in a filestore
              > * Lookup of the remote Topic is done via JNDI
              >
              > Since the processing and forwarding of messages occurs the way it should when everything is local, I am inclined to believe one of two things:
              > a) There's some issue with the way WLS treats messages (or even just payloads) when they come from a remote server
              > b) WLS is doing something I'm not aware of when propagating a transaction that begins with the delivery of a message from a remote JMS Topic when it involves further forwarding of messages in local JMS Queues.
              >
              > Any help will be appreciated.
              >
              > regards,
              > .munir estevane
              

  • Help ! Getting a MDB on Weblogic 8.1 to work with SonicMQ 6.1

    Hello all,
    Iam trying to get an MDB on WLS to listen to a Sonic MQ installation. Iam using Sonic's built in JNDI and have made the necessary setting under Foreign JMS server under Weblogic console (I followed the code share available on Sonic's site!). But the MDB always starts with the following warning and does not listen to the Q.
    <Jan 9, 2006 11:47:07 PM CST> <Warning> <EJB> <BEA-010061> <The Message-Driven EJB: SonicMDB is unable to connect to the JMS destination: jms/SampleQ1. The Error was:
    [EJB:011010]The JMS destination with the JNDI name: jms/SampleQ1 could not be found. Please ensure that the JNDI name in the weblogic-ejb-jar.xml is correct, and the JMS destination has been deployed.>
    This is my weblogic-ejb-jar.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN" "http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd">
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>SonicMDB</ejb-name>
    <message-driven-descriptor>
    <pool>
    <max-beans-in-free-pool>2</max-beans-in-free-pool>
    <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
    </pool>
    <destination-jndi-name>jms/SampleQ1</destination-jndi-name>
    <initial-context-factory>weblogic.jndi.WLInitialContextFactory</initial-context-factory>
    <provider-url>t3://localhost:7001</provider-url>
    <connection-factory-jndi-name>jms/QCF</connection-factory-jndi-name>
    </message-driven-descriptor>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    I have configured the jndi name for the destination and connection factory correctly under the console.. Is there a bug with WLS 8.1 SP4?
    Iam not using the Sun's FSContext but the Sonic's jndi. I have added the following sonic jars to the wls classpath:
    ------------------------------------------------------=--------
    @rem Add the Sonic JMS Provider
    set SONICMQ_LIB=<SONIC_HOME>\lib
    set SONICMQ_CLASSPATH=%SONICMQ_LIB%\mfcontext.jar;%SONICMQ_LIB%\sonic_Client.jar;%SONICMQ_LIB%\sonic_ASPI.jar;%SONICMQ_LIB%\sonic_XA.jar;%SONICMQ_LIB%\sonic_Selector.jar;%SONICMQ_LIB%\sonic_Crypto.jar;%SONICMQ_LIB%\jndi.jar
    set WEBLOGIC_CLASSPATH=%WEBLOGIC_CLASSPATH%;%SONICMQ_CLASSPATH%
    This is my foreign JMS server configuration in WLS console
    Name: WLSSONIC
    JNDI Initial Context Factory: com.sonicsw.jndi.mfcontext.MFContextFactory
    JNDI Provider URL: tcp://localhost:2506
    JNDI Properties:
    com.sonicsw.jndi.mfcontext.idleTimeout=6000
    com.sonicsw.jndi.mfcontext.domain=Domain1
    java.naming.security.principal=Administrator
    java.naming.security.credentials=Administrator
    This is the snippet from WLS config.xml
    <ForeignJMSServer ConnectionURL="tcp://localhost:2506"
    InitialContextFactory="com.sonicsw.jndi.mfcontext.MFContextFactory"
    JNDIProperties="java.naming.provider.url=tcp://localhost:2506;java.naming.factory.initial=com.sonicsw.jndi.mfcontext.MFContextFactory;com.sonicsw.jndi.mfcontext.idleTimeout=6000;com.sonicsw.jndi.mfcontext.domain=Domain1 java.naming.security.principal=Administrator java.naming.security.credentials=Administrator" Name="WLSSONIC">
    <ForeignJMSConnectionFactory LocalJNDIName="jms/QCF"
    Name="SonicMQQueueConnectionFactory"
    PasswordEncrypted="{3DES}O26K63V7o0pOryfotUFNpA=="
    RemoteJNDIName="SonicMQQueueConnectionFactory" Username="Administrator"/>
    <ForeignJMSDestination LocalJNDIName="jms/SampleQ1"
    Name="SonicMQSampleQ1" RemoteJNDIName="SonicMQSampleQ1"/>
    </ForeignJMSServer>
    ---------------------------------------------------------------------

    good that you posted the SoniqMQ params.
    You have configured WLS to look for the Local JNDI names in the MQ params.
    You need to use
    "SonicMQSampleQ1" for destination-jndi-name
    AND
    "SonicMQQueueConnectionFactory" for connection-factory-jndi-name
    Hope this helps.
    Thanks and regards,
    Pazhanikanthan. P

  • Making MDB listen to a queue

    Hi all,
    Can any one tell me how to make an MDBean listen to a Queue Using JDev wizard.
    Kindly help....

    mshreedhaaran wrote:
    Hi,
    Thanks to the below post(s) -
    <a class="jive-link-external" href="http://ibswings.blogspot.com/2008/02/integrating-mq-broker-6-with-bea.html">http://ibswings.blogspot.com/2008/02/integrating-mq-broker-6-with-bea.html</a>
    <a class="jive-link-external" href="http://www-128.ibm.com/developerworks/websphere/library/techarticles/0604_kesavan/0604_kesavan.html">http://www-128.ibm.com/developerworks/websphere/library/techarticles/0604_kesavan/0604_kesavan.html</a>
    I have been able to get this far (ofcourse explained very well step by step in these posts). So MDB on WLS can pick messages from a Queue on MQ Server on the same machine.
    If someone can highlight what <font face="tahoma,verdana,sans-serif" size="1" color="#000">changes</font> I have to make to get the MDB to pick message from the Queue when MQ Server is on a different machine.
    Thanks in advance.
    best regards,
    MuraliIt's helpful to me, Thanks for your sharing! Now I understand more about it, It's quite useful.

  • Message Driven Bean: problem with @RunAs annotation

    I am having a problem using the @RunAs annotation in a message driven bean.
    I would like the code in my onMessage() method to be executed with a specific role/user, so I want to use the @RunAs annotation to achieve this.
    I am running weblogic 10.0.
    I have created the following in weblogic console:
    - Group "TestGroup"
    - User "TestUser", member of "TestGroup"
    - Global Role "TestRole", role condition: "Group : TestGroup"
    The MDB:
    package be.cegeka.test.mdb;
    import javax.annotation.Resource;
    import javax.annotation.security.RunAs;
    import javax.ejb.ActivationConfigProperty;
    import javax.ejb.MessageDriven;
    import javax.ejb.MessageDrivenContext;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    @MessageDriven(
              mappedName = "testQueue",
              name = "TestMDB",
              activationConfig = {
                        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
    @RunAs("TestRole")
    public class TestMDB implements MessageListener {
         @Resource
         private MessageDrivenContext mdContext;
          * {@inheritDoc}}
         public void onMessage(Message msg) {
              System.out.println("Handling message for user "
                        + mdContext.getCallerPrincipal().getName());
    }[u]The ejb-jar.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
    version="3.0">
         <assembly-descriptor>
              <security-role>
                   <description>
                        Test Role.
                   </description>
                   <role-name>TestRole</role-name>
              </security-role>
         </assembly-descriptor>
    </ejb-jar>
    The weblogic-ejb-jar.xml file:
    <weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/10.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.bea.com/ns/weblogic/10.0 http://www.bea.com/ns/weblogic/10.0/weblogic-ejb-jar.xsd">
         <security-role-assignment>
              <role-name>TestRole</role-name>
              <principal-name>TestUser</principal-name>
         </security-role-assignment>
    </weblogic-ejb-jar>I would have thought that the onMessage of the MDB would print "Handling message for user TestUser", but instead it prints "Handling message for user <anonymous>".
    It seems as though the @RunAs annotation has no effect. Although I specified the role TestRole (mapped to the user TestUser), the code still seems to be executed by user anonymous.
    Am I missing something?
    Any help would be much appreciated! I've been looking at this poblem for quite a while now.

    Both beans (the MDB on WLS 10 and the session bean on WLS 8.1) use container managed transactions.
    For the MDB I do not explicitly set the transaction attributes, so it should default to container managed transactions.
    For the stateless session bean I have specified the following in the ejb-jar.xml file:
    <ejb-jar>
      <display-name>Weblogic8Service</display-name>
      <enterprise-beans>
        <session>
          <ejb-name>Weblogic8Service</ejb-name>
          <home>be.cegeka.rszv.test.session.Weblogic8ServiceRemoteHome</home>
          <remote>be.cegeka.rszv.test.session.Weblogic8ServiceRemote</remote>
          <ejb-class>be.cegeka.rszv.test.session.Weblogic8ServiceBean</ejb-class>
          <session-type>Stateless</session-type>
          <transaction-type>Container</transaction-type>
        </session>
      </enterprise-beans>
      <assembly-descriptor>
        <container-transaction>
          <method>
            <ejb-name>Weblogic8Service</ejb-name>
            <method-name>*</method-name>
          </method>
          <trans-attribute>Required</trans-attribute>
        </container-transaction>
      </assembly-descriptor>
    </ejb-jar>So as far as I understand it the transaction starts at the MDB (upon receival of a message). The transaction for the remote call to the stateless session bean (in the onMessage() of the MDB) is included in the transaction of the MDB and gets committed when the onMessage() method finishes and the transaction of the MDB itself gets committed.
    Correct me if I'm wrong here.

  • JMS control

    (How) can I use a JMS control to deploy an MDB to WLS? I tried to do so in a sample app but it seems that Workshop only deploys a control (and the underlying beans) if it is accessed by the application (a JWS in my case). If I develop a JMS control but not use it I can't find the corresponding MDB deployed.
    Can somebody help me?

    My actual workaround is to declare in the JWS a member variable of the type of the JMS control I'm trying to deploy and it works (but doesn't look great).
    Regards.
    Antonio.

  • JMS Properties in JNDI Directory

    We are starting to use Message-Driven-Beans within our WLS 8 environment. My responsibility
    is for WebSphere MQ and JMS. Currently our JMS usage has been such that that the
    connection_factory information is stored in a central LDAP directory and administered
    by the WebSphere MQ team. The queue objects are administered by the application
    teams and kept locally. We would like to keep this concept also when using MDBs
    in WLS. Looking at the configuration I cannot see how I could define two seperate
    JNDI (initial_context) references - one for the queue object and a different one
    for the connection_factory.
    Any ideas?
    Thanks in advance,
    Martin
    PS: Using MQ as transport for JMS is mandatory!

    If your program is in an executeable jar file then add the following in the manifest
    class-path: junk.jar
    junk.jar has
    pjb/props/myconfig.properties file
    To access the properties in junk from your executable jar file in your class, do the following
    Locale eng = Locale.ENGLISH;
    String myvalue  = java.util.ResourceBundle.getBundle("pjb.props.myconfig",eng).getString("greeting");That should work
    Or if you not using an executable jar file just set your CLASSPATH to the directory where that junk.jar is.
    java -cp c:\myjavalib\stash\                 <-----Assmuing junk.jar is in thereJava dynamically reads jar files.

  • JMS bridge communication not working

    Hi,
    I am working on an application, Ap1, which uses Toplink as an ORM layer and also makes use of Toplink cache. The problem is that the database that this application uses
    is also used by another app, Ap2. So I need somehow to refresh Toplink cache of Ap1 when a database update is triggered by Ap2, otherwhise Ap1 will work with out of date data.
    The solution that I found is to use JMS for the communication between the 2 aps and it should work like this:
    - when Ap2 make a database update, it will add a message in a JMS topic that a MDB deployed on Ap1 listens to. And so the MDB will remove the entity from the cache.
    The thing is that A1 and A2 are deployed on different Weblogic servers so I need to have a remote JMS communication between the 2 servers.
    Ap1 is deployed on WLS1 (Weblogic 12C).
    Ap2 is deployed on WLS2 (Weblogic 11C).
    As solutions I tried to use a JMS bridge.
    on the WLS1 side I have created:
    - a JMS server, JmsServer-0
    - a JMS module, JmsModule
    - a local topic included in JmsModule and targeted to JmsServer-0
    - a ConnectionFactory included in JmsModule and targeted to JmsServer-0 (not sure if it is needed)
    - a JMS bridge with source and target configured OK (Bridge is in Active state)
    The outcome is that when Ap2 updates the database, I can see the message in Ap2 JMS server, but I can't see it in Ap1 JMS server even if the JMS bridge appears to be created OK, has state Active.
    I don't know why the message doesn't reach A1 JMS server and I don't know how to debug this problem. I am looking in the Jms Server, monitorring tab. Is there any other place Where I can get some useful info?
    I also tried using a JMS foreign server, but I had the same problem.
    Thanks for any suggestion!

    First of all, you can configure the MDB on WLS server1 to receive messages from a JMS destination that is running on WLS server2. You just need to provide the URL of the remote server.
    If you prefer using the messaging bridge, you can debug your bridge by turning on the bridge debugging flags.
    -Dweblogic.Debug.DebugMessagingBridgeStartup=true
    -Dweblogic.Debug.DebugMessagingBridgeRuntime=true
    -Dweblogic.Debug.DebugMessagingBridgeRuntimeVerbose=true
    Hope this helps.
    Dongbo

  • Message Delivery Order

              Hi,
              I am looking to exactly match the order of delivery of the messages published
              to a topic to the order of delivery the messages are subscribed to by MDB listening
              to the topic. From the documentation, I could make out that this order of delivery
              is guaranteed by JMS for normal mode of operation, but it is not guaranteed for
              redelivered messages. I could find out from the previous postings in this forum
              that WLS 8.1 does guarantee the order of delivery even for redelivered and recovered
              messages but the previous versions do not. We are using WLS 6.1 and hence I can
              conclude that the order is not guaranteed for redelivered messages. I would like
              to know if there is any other way to achieve this guaranteed order of delivery.
              I was just thinking in the lines of configuring a destination key for the topic
              with JMSMessageId set to ascending so that it is always FIFO and setting the MessagesMaximum
              field for the MDB's connectionFactory to 1. Would that make sure that the order
              is maintained even for redelivered messages ?
              Please help.
              Thanks,
              Goutam.
              

              Saswati Mukherjee wrote:
              > Hi Tom,
              >
              > Thanks a lot for the information. In our case the MDB has to be transactional.
              > Meaning, if the processing of the message in the onMessage() of the MDB is not
              > as expected, then we should rollback that message and try to do the same processing
              > again. I am not sure if there is any other way to accomplish this other than making
              > the MDB transactional. If there is not, then I think the first option you have
              > mentioned is ruled out for our case. Please confirm.
              I think so, but I recommend seeing if you can get a second opinion.
              One thing you could try, but I'm not 100% sure if it would always
              work, would be to cache the message-id of the message you are
              rolling back. Then, keep forcing roll backs on subsequent
              messages until the cached message is received again. You might
              try raising this solution through customer support to see
              if you can get confirmation as to whether this would work.
              > Then I would try to explore
              > the second option you have mentioned, i.e. running the MDB in WLS 6.1 and running
              > the JMS in WLS 8.1.
              If it is possible for you to go this route, I recommend it. Again, it
              would need customer support verification to see if this is supported.
              >
              > Thanks again,
              > Saswati.
              >
              >
              > Tom Barnes <[email protected].bea.com>
              > wrote:
              >
              >>
              >>Saswati Mukherjee wrote:
              >>
              >>
              >>>Hi,
              >>>
              >>>I am looking to exactly match the order of delivery of the messages
              >>
              >>published
              >>
              >>>to a topic to the order of delivery the messages are subscribed to
              >>
              >>by MDB listening
              >>
              >>>to the topic. From the documentation, I could make out that this order
              >>
              >>of delivery
              >>
              >>>is guaranteed by JMS for normal mode of operation, but it is not guaranteed
              >>
              >>for
              >>
              >>>redelivered messages. I could find out from the previous postings in
              >>
              >>this forum
              >>
              >>>that WLS 8.1 does guarantee the order of delivery even for redelivered
              >>
              >>and recovered
              >>
              >>>messages but the previous versions do not. We are using WLS 6.1 and
              >>
              >>hence I can
              >>
              >>>conclude that the order is not guaranteed for redelivered messages.
              >>
              >>I would like
              >>
              >>>to know if there is any other way to achieve this guaranteed order
              >>
              >>of delivery.
              >>
              >>>I was just thinking in the lines of configuring a destination key for
              >>
              >>the topic
              >>
              >>>with JMSMessageId set to ascending so that it is always FIFO and setting
              >>
              >>the MessagesMaximum
              >>
              >>>field for the MDB's connectionFactory to 1. Would that make sure that
              >>
              >>the order
              >>
              >>>is maintained even for redelivered messages ?
              >>
              >>No, it would not. In fact, JMS already does this much.
              >>
              >>Actually, you might be able to take advantage of MDB's defined
              >>side-effects: When a Runtime is thrown from "onMessage()"
              >>of a non-transactional MDB, the instance closes and then
              >>recreates itself (and its subscription).
              >>- So assuming the MDB is non-transactional...
              >>- And assuming "max-beans-in-free-pool" is set to "1"...
              >>- If the MDB is a durable subscriber it won't be able
              >>to automatically recreate itself and reconnect until the
              >>old previous instance finishes closing, the messages
              >>will be ordered for the new instance.
              >>- If the MDB is a nondurable subscriber, then the recreate
              >>will, by definition, be an entirely new subscription,
              >>and ordering will be fine. (But messages sent to
              >>the topic will be missed while the session is
              >>recreating itself.)
              >>
              >>Another option is to continue to use 6.1 for the MDB but
              >>start up and 8.1 instance solely for running JMS remotely.
              >>I'm not 100% sure, but I think ordering would
              >>be guaranteed on the 6.1 JMS client as long you follow
              >>the documented 8.1 ordered redelivery restrictions. Contact
              >>BEA support to confirm.
              >>
              >>
              >>
              >>>Please help.
              >>>
              >>>Thanks,
              >>>Goutam.
              >>
              >
              

  • 8.1, 9.1 and 10.

    Hi,
              I've written a small application to monitor a JMS Queue, it was working fine, until I needed to add a webservice. I decided to use Axis2 and now the JMS Queue code no longer works:
              java.lang.ClassCastException: weblogic.jms.client.JMSConnectionFactory cannot be cast to javax.jms.TopicConnectionFactory
              The server I'm connecting to uses Weblogic 8.1, the server I am using uses Tomcat 6.0 and Axis2 (1.3). I am also using the weblogic.jar from 8.1 and this is what I believe the problem to be: Axis2 has an updated version of the javax.jms.TopicConnectionFactory class.
              Question 1. Is it possible to use the weblogic.jar from version 9.1 or 10 to connect to a weblogic 8.1 server? I am assuming they also use the updated class?
              Question 2. If I must use the weblogic.jar from 8.1, is there a work around to get Axis2 and weblogic working together?
              Thanks in advance for any and all assistance,

    Clearly the wrong class loader is being used to access the queue.
              - Perhaps you can configure Axis2 to use WebLogic classes, or
              - you can deploy a MDB on WLS to track the queue and JMS messages and find a way to send this data into Axis2, or
              - perhaps you can surround your old JMS client with a wrapper that will use weblogic.jar first in a classloader.
              -Sal
              Sal Gambino, BEA Messaging Team Lead

  • Need the most performance and scalable way to "trigger" JavaEE application

    Hi,
    Need the most performance and scalable way to "trigger" JavaEE application code running on WLS from PLSQL code.
    There are some thirdparty JavaEE application running on WLS that we need to invoke from PLSQL code. I have looked at couple of options:
    Option 1)
    Use oracle db callouts(http call etc.) but it seems the connection to WLS will not be maintained across database-sessions and so every call from different plsql database-session will make fresh TCP/IP connection. Usually fresh socket connection setup is expensive and can become a bottleneck.
    Option 2)
    Use AQ in the database from PLSQL and have a MDB in WLS to invoke the java code. The problem here is how do I simulate the Request/Reply pattern using the AQ API from PLSQL. The PLSQL code needs to wait until the JavaEE code completes as it needs some result back from JavaEE app. AQ also does not have true temporary queues so I am not sure how it will work with concurrent user/sessions.
    Option 3)
    Use Java in the database, we have tried this but for our usecase it is too expensive resource wise and is not meeting our performance needs.
    Performance is the triggering mechanism is of highest interest to us.
    Any suggestions/pointers is greatly appreciated.
    Thanks,
    Prantor
    Edited by: Prantor on Nov 8, 2010 10:37 PM

    Perhaps you would benefit from viewing the problem differently.
    In some/many/most cases the application server (WLS) invokes procedure residing in the DB server.
    Place the control for the desired results in the application code running on the WLS.

Maybe you are looking for

  • Nokia Lumia 925 with Black update - When low light...

    The ambient light sensor doesn't seem to be correctly used in low light conditions. In low light, with the phone "locked", just push the middle unlock button. The screen show the usual unlock screen, but at high brightness, for what seems to be a var

  • Start process from global creation using a signal in Oracle SOA Suite 11g

    I want to start a process using a signal or an automatic activity from a link in the BPM workspace. The only way I have found to do that is using an initiator human task activity, but I just want to execute some script activities without a task flow.

  • Workflow Runtime Event Queue Data

    Does a script exist to cleanup the runtime data in the WF Event queue's ???

  • 4.0 Bug - Drag and Drop File to Editor

    Another one: Unable to Drag/Drop File In 3.2.2, I could drag a file from the explorer window into SQL Developer to have SQL Developer open it in a new tab.  I have been unable to get this work in 4.0 Beta.

  • WPA Support for Tecra 9100

    Hi all, anyone know if there is WPA support for the internal WLAN module in the Tecra 9100 in the works, or even available? Regards, Tom