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

Similar Messages

  • Error While accessing JMS Queue on Weblogic***** ASSERTION FAILED *****[ Environment not found on thread ]

    Hi,
    I am trying to read response from JMS Queue hosted on Weblogic server and getting below exception. Any help on this will be appreciable.
    weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Environment not found on thread ]
          at weblogic.jndi.internal.NamingNodeReplicaHandler.<init>(NamingNodeReplicaHandler.java:148)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
          at java.lang.Class.newInstance0(Class.java:308)
          at java.lang.Class.newInstance(Class.java:261)
          at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:90)
          at weblogic.common.internal.ChunkedObjectInputStream.readObjectWL(ChunkedObjectInputStream.java:159)
          at weblogic.common.internal.ChunkedObjectInputStream$NestedObjectInputStream.readObjectWL(ChunkedObjectInputStream.java:341)
          at weblogic.rmi.cluster.ReplicaAwareRemoteRef.readExternal(ReplicaAwareRemoteRef.java:356)
          at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
          at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
          at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:452)
          at weblogic.rmi.internal.StubInfo.readObject(StubInfo.java:95)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:324)
          at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
          at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
          at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:111)
          at weblogic.common.internal.ChunkedObjectInputStream.readObjectWL(ChunkedObjectInputStream.java:159)
          at weblogic.common.internal.ChunkedObjectInputStream$NestedObjectInputStream.readObjectWL(ChunkedObjectInputStream.java:341)
          at weblogic.jndi.internal.WLContextImpl.readExternal(WLContextImpl.java:425)
          at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
          at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
          at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
          at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
          at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
          at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:111)
          at weblogic.rjvm.ResponseImpl.getThrowable(ResponseImpl.java:117)
          at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:106)
          at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:127)
          at weblogic.jms.dispatcher.DispatcherImpl_1035_WLStub.dispatchSyncNoTranFuture(Unknown Source)
          at weblogic.jms.dispatcher.DispatcherWrapperState.dispatchSyncNoTran(DispatcherWrapperState.java:341)
          at weblogic.jms.client.JMSSession.createDestination(JMSSession.java:1735)
          at weblogic.jms.client.JMSSession.createQueue(JMSSession.java:1296)
    Thanks

    Hi,
    I am trying to read Queue standalone. Please find the code snippet below.  code highlighted in  where i am getting exception.
    public static void main(String[] args) {
    String jmsServerUrl = "t3://10.51.245.45:5858";
    String jmsUserName = "weblogic";
    String jmsPassword = "welcome123";
    String jndiFactory = "weblogic.jndi.WLInitialContextFactory";
    String jmsFactory = "jms/CBCMReplyConnectionFactory";
    String qName = "jms/CBCMOrderReplyQueue";
    QueueReceiver qReciever = null;
    JMSQueueReader.getQueueSession(jmsServerUrl,jmsUserName,jmsPassword,jndiFactory,jmsFactory);
    qReciever = JMSQueueReader.getQueueReceiver(qName);
    if (qReciever == null) {
    System.out.println("Unable to find JMS Queue Reciever for Queue Name: "
    + qName + " and JMS Server URL:"
    + jmsServerUrl);
    //isProcess = false;
    private static InitialContext getInitialContext(String url, String userName, String password,  String jndiFactory) throws NamingException {
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, jndiFactory);
    env.put(Context.PROVIDER_URL, url);
    env.put(Context.SECURITY_PRINCIPAL, userName);
    env.put(Context.SECURITY_CREDENTIALS, password);
    return new InitialContext(env);
    public static QueueReceiver getQueueReceiver(String qName) {
    try {
    if(qReceiver == null || !qName.equals(queueName))
    queueName = qName;
    if(qReceiver != null)
    qReceiver.close();
    qReceiver = null;
    javax.jms.Queue queue = qSession.createQueue(queueName);
    //qReceiver = qSession.createReceiver(queue);
    qReceiver = qSession.createReceiver(queue, "JMSCorrelationID LIKE '"+SOHConstant.CBCM_BSCS_CORRELATION_ID_PREFIX+"%'");
                } catch (Throwable e) {
    e.printStackTrace();
    return qReceiver;

  • 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
              

  • 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
              >
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             

  • Message Driven Bean reading multiple times from a jms queue

    Hi,
    I am facing a strange problem with my message driven bean. Its configured to read message from a jms queue. But sometimes it read the same message multiple times from the jms queue.
    We are using weblogic server 8.1 sp5.
    Please find below our descriptor files
    ejb-jar.xml  
    <ejb-jar>  
      <display-name>ClarifyCRM_Process_Manager_13.1</display-name>  
      <enterprise-beans>  
        <session>  
          <display-name>ProcessManager</display-name>  
          <ejb-name>ProcessManager</ejb-name>  
          <home>com.clarify.procmgr.ejb.ProcessManagerHome</home>  
          <remote>com.clarify.procmgr.ejb.ProcessManagerRemote</remote>  
          <ejb-class>com.clarify.procmgr.ejb.ProcessManagerEJB</ejb-class>  
          <session-type>Stateless</session-type>  
          <transaction-type>Container</transaction-type>  
        </session>  
        <message-driven>  
          <display-name>ProcessManagerListener</display-name>  
          <ejb-name>ProcessManagerListener</ejb-name>  
          <ejb-class>com.clarify.procmgr.ejb.ProcessManagerMDB</ejb-class>  
          <transaction-type>Bean</transaction-type>  
          <acknowledge-mode>Auto-acknowledge</acknowledge-mode>  
          <message-driven-destination>  
            <destination-type>javax.jms.Queue</destination-type>  
          </message-driven-destination>  
        </message-driven>  
      </enterprise-beans>  
      <assembly-descriptor>  
        <container-transaction>  
          <method>  
            <ejb-name>ProcessManager</ejb-name>  
            <method-name>*</method-name>  
          </method>  
          <trans-attribute>Required</trans-attribute>  
        </container-transaction>  
      </assembly-descriptor>  
    </ejb-jar>  
    weblogic-ejb-jar.xml  
    <weblogic-ejb-jar>  
      <weblogic-enterprise-bean>  
        <ejb-name>ProcessManager</ejb-name>  
        <stateless-session-descriptor>  
          <pool>  
            <max-beans-in-free-pool>100</max-beans-in-free-pool>  
            <initial-beans-in-free-pool>10</initial-beans-in-free-pool>  
          </pool>  
        </stateless-session-descriptor>  
        <enable-call-by-reference>False</enable-call-by-reference>  
        <jndi-name>ProcessManagerHome</jndi-name>  
        <dispatch-policy>PMExecuteQueue</dispatch-policy>  
        <remote-client-timeout>0</remote-client-timeout>  
      </weblogic-enterprise-bean>  
      <weblogic-enterprise-bean>  
        <ejb-name>ProcessManagerListener</ejb-name>  
        <message-driven-descriptor>  
          <pool>  
            <max-beans-in-free-pool>100</max-beans-in-free-pool>  
            <initial-beans-in-free-pool>10</initial-beans-in-free-pool>  
          </pool>  
          <destination-jndi-name>clarify.procmgr.jms.queue.Execution</destination-jndi-name>  
          <connection-factory-jndi-name>clarify.procmgr.jms.factories.ExecConnection</connection-factory-jndi-name>  
        </message-driven-descriptor>  
        <enable-call-by-reference>True</enable-call-by-reference>  
        <dispatch-policy>PMListenerExecuteQueue</dispatch-policy>  
        <remote-client-timeout>0</remote-client-timeout>  
      </weblogic-enterprise-bean>  
    </weblogic-ejb-jar>   The MDB is sometimes reading multiple times from clarify.procmgr.jms.queue.Execution
    Also i would like to add here that the connection factory we are using clarify.procmgr.jms.factories.ExecConnection is having the following properties
    ServerAffinity Enabled=true
    XA connection factory enabled=false.
    Please help me out here!!

    Maybe, your MDB "sometimes" throws an Exception in onMessage.
    Check if this happens when you set <max-beans-in-free-pool>1</max-beans-in-free-pool>.

  • MDB failing to commit

    Using weblogic 6.1 SP 4
    I have a simple container managed Message Driven Bean. Using a destination type
    javax.jms.Queue.
    When the onMessage method finishes the Message is still Pending on the queue.
    see the ejb-jar.xml below
    <ejb-jar>
    <enterprise-beans>
    <message-driven>
    <display-name>IvrMessageBean</display-name>
    <ejb-name>IvrMsgBean</ejb-name>
    <ejb-class>com.edocs.ps.ivr.IvrMsgBean</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>
    </message-driven>
    </enterprise-beans>
    </ejb-jar>
    I noticed when I set a JDBC TX DataSource to 2 Phase Commit, the JMS transaction
    started commitig and nothing was left pending in the Queue.
    Does 2PC have to be set in a DataSource for Container Managed MDB's to work?

    You have to use TxDataSource for container managed tx or if you are using JTA (in
    addition to ofcourse doing 2PC).
    S
    "Dale Olzer" <[email protected]> wrote:
    >
    Using weblogic 6.1 SP 4
    I have a simple container managed Message Driven Bean. Using a destination
    type
    javax.jms.Queue.
    When the onMessage method finishes the Message is still Pending on the
    queue.
    see the ejb-jar.xml below
    <ejb-jar>
    <enterprise-beans>
    <message-driven>
    <display-name>IvrMessageBean</display-name>
    <ejb-name>IvrMsgBean</ejb-name>
    <ejb-class>com.edocs.ps.ivr.IvrMsgBean</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>
    </message-driven>
    </enterprise-beans>
    </ejb-jar>
    I noticed when I set a JDBC TX DataSource to 2 Phase Commit, the JMS
    transaction
    started commitig and nothing was left pending in the Queue.
    Does 2PC have to be set in a DataSource for Container Managed MDB's to
    work?

  • JMS Queue - lookup error

    Hi All,
    I have created a queue 'JMSTestQueue' through the Visual Administrator/ JMS Provider.
    I have also created an MDB in which the ejb-j2ee-engine.xml contains a parameter as
    <destination-name>JMSTestQueue</destination-name>
    Now, when I try to deploy my MDB I get an exception saying
    that
    javax.resource.spi.UnavailableException: The destination JMSTestQueue cannot be looked up. Last attempt performed : jms_vendor_queues_global/JMSTestQueue.
    Now here I can't understand that why the container is making a lookup in the path jms_vendor_queues_global.
    Because the JMS queue I have created has the JNDI path as
    jmsqueues/default/JMSTestQueue
    Another twist to the tale is that when I use the default JMS queue by the name 'JobQueue', then the MDB is deployed succesfully. This means the 'lookup' is successful.
    How do I solve this issue? I want to use a new JMS Queue with my MDB.
    I'll be really grateful, if someone can help me out.
    Thanks and Regards,
    Gagan Parhar.

    Hi All,
    I have created a queue 'JMSTestQueue' through the Visual Administrator/ JMS Provider.
    I have also created an MDB in which the ejb-j2ee-engine.xml contains a parameter as
    <destination-name>JMSTestQueue</destination-name>
    Now, when I try to deploy my MDB I get an exception saying
    that
    javax.resource.spi.UnavailableException: The destination JMSTestQueue cannot be looked up. Last attempt performed : jms_vendor_queues_global/JMSTestQueue.
    Now here I can't understand that why the container is making a lookup in the path jms_vendor_queues_global.
    Because the JMS queue I have created has the JNDI path as
    jmsqueues/default/JMSTestQueue
    Another twist to the tale is that when I use the default JMS queue by the name 'JobQueue', then the MDB is deployed succesfully. This means the 'lookup' is successful.
    How do I solve this issue? I want to use a new JMS Queue with my MDB.
    I'll be really grateful, if someone can help me out.
    Thanks and Regards,
    Gagan Parhar.

  • 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

  • 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?
              >>
              >
              

  • 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/

  • MDBs failed to connect to remote JMS server

    Hi,
              We currently have 2 clusters: one is a regular cluster (cluster1) and the other is JMS cluster (cluster2). Our JMS server and filestore are targeted to a migratable server in JMS cluster.
              In our weblogic-ejb-jar.xml, we added element <provider-url> to the <message-driven-descriptor> to allow JMS remote connection as follows:
              <weblogic-enterprise-bean>
                   <ejb-name>MyBean</ejb-name>
                   <message-driven-descriptor>
                        <destination-jndi-name>MyTopic</destination-jndi-name>
              <provider-url>t3://myhost:19009,myhost:19011</provider-url>
              <connection-factory-jndi-name>MyConnectionFactory</connection-factory-jn
              di-name>
                   </message-driven-descriptor>
              </weblogic-enterprise-bean>
              When we deployed our application, the Connection Status of MyBean showed "disconnected". I have tried different values (t3://myhost:19009;t3://myhost:19011) and
              (t3://myhost:19009) but got the same result.
              When I re-targeted the JMS server and filestore to a regular server (instead of migratable server), I was able to connect remotely. But because we want to be able to migrate our JMS server (auto and manually), I have to target it to a migratable server.
              I could not figure out why my MDBs failed to connect to a remote JMS server when it is targeted to a migratable server? Is there a restriction that we have to target to a regular server in order to connect remotely or I'm doing something wrong?
              Any help would be greatly appreciated.
              Thanks,
              Thao

    I'm using WL9.2 and my migratable server is actually up and running (is that what you mean about booted?).                    I meant checking your log files to make sure that the JMS server itself actually booted, not checking that the host WL server was up. (For example you should see INFO messages indicating that the JMS server has loaded "X" records from its persistent store).
              >>> Could you elaborate on the known problem?
              9.x MDBs have special code for enhanced handling of remote distributed destinations. I'm guessing that this code is somehow causing problems when the remote JMS server is migratable. I don't have enough information to elaborate further than that.
              >>> What else I can try?
              Beyond contacting customer support, I'm not sure.
              Tom

  • Oracle Service Bus - Alert Destination on JMS Queue

    Hi Guys, I have been trying to create Alert destination with email destinations and have been successful. The problem that I am facing now is when I am trying to create an Alert Destination to a JMS Queue. I am using the correct format that you generally use for a JMS URI. -- jms://<host>:port/<factoryJNDIName>/<QueueJNDIName>
    This, is the scenario. I have an Alert Rule specified in one of my proxy services, which basically sends out the fault to the Alert Destination as configured above. This alert will be triggered
    when the error count in the Proxy Service exceeds 3. But I do not seem to be getting the messages into my queue which I am monitoring from weblogic console.
    However, I do get all the messages that I trigger from a separate biz service that I had made just to test the authenticity of my JMS Configuration.
    Any one experienced this before? Specifically related to SLA Alerts/Alert Destinations configuration on JMS Queues?

    Thank you for your response. Well, Let me see if I can explain in a clearer way.
    As you already know, Alert Destination (used for SLA Alerting for example) in OSB have two destinations that you can configure. One - an email recipient(s), who will get the email when the alert (configured in your proxy service and bounded to this alert destination is triggered) . Two - a jms queue, where the same "alert" can be pushed to.
    My question is - I have configured the JMS Destination on the Alert Destination configuration page as such - jms://localhost:7001/testConnFact/testQueue
    (testConnFact and testQueue being the JNDI names of the connection factory and queue respectively configured in weblogic server)
    When the alert (configured in the proxy service) is triggered, (like maybe, due to the error count being more than 3), I should be getting the message pushed into the queue, because, that's the destination I have set in this ALERT DESTINATION.
    I am NOT getting it however.
    On a diff note, when I am creating a business service in OSB on a JMS protocol giving the URI of the queue created in weblogic, I AM getting the messages into the Queue. This, I had done, to test whether my configuration for the queue is correct or not.
    So it seems that Queue configuration on weblogic is correct, however, the alert destination is simply not pushing the messages to the queue.
    Hope this was clear.

  • 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

  • Creating XML string to be pushed into a JMS queue

    Hello All
    I am trying to pass the following XML string into a sender obj, however, I am not sure how it is supposed to be done, with the right escape sequencing.
    message.setText("<rawData><Name="Mike"></Name><Value="200"></rawData>");
    Please guide me.
    Thanks,
    AJ

    Login User should have the Admin privilege, Otherwise it is not possible to post data manually into the JMS Queue.
    Log into weblogic Console > click on JMS Module > <select the JMSModule where the Queue resides : e.g SOAJMSModule> >Select the Queue > Monitoring > Check the Box > click on "Show Message" > New > Post the data in "Body" section.
    Or, you can create another BS in OSB, pointing to that JMS Queue(using Input.xsd) . then execute the BS using your Input.xml

Maybe you are looking for