3 Replies Latest reply: Mar 27, 2012 8:25 AM by 916271 RSS

    <Warning> <EJB> <BEA-010061>

    916271
      Hi!

      I want make a MDB (WebLogic 10.3) listen a topic (configured in a domain), but I can't because of this warning:

      *<26/03/2012 09h36min38s BRT> <Warning> <EJB> <BEA-010061> <The Message-Driven EJB: MessageDrivenBean is unable to connect to the JMS destination: jms/TesteTopic. The Error was:*
      The destination for the MDB MessageDrivenBean(Application: Testes, EJBComponent: TesteTopicEJB.jar) could not be resolved at this time.  Please ensure the destination is available at the JNDI name jms/TesteTopic.  The EJB container will periodically attempt to resolve this MDB destination and additional warnings may be issued.>

      The code is below:

      EJB

      package testetopic;

      import javax.ejb.ActivationConfigProperty;
      import javax.ejb.MessageDriven;

      import javax.ejb.TransactionManagement;
      import javax.ejb.TransactionManagementType;

      import javax.jms.JMSException;
      import javax.jms.Message;
      import javax.jms.MessageListener;
      import javax.jms.TextMessage;


      @MessageDriven(activationConfig = {
                @ActivationConfigProperty(propertyName = "destinationType",
                propertyValue = "javax.jms.Topic"),
                @ActivationConfigProperty(propertyName = "subscriptionDurability",
                propertyValue = "Durable"),
                @ActivationConfigProperty(propertyName = "connectionFactoryJndiName",
                propertyValue = "jms/TesteConnectionFactory"),
      @ActivationConfigProperty(propertyName = "initialContextFactory",
      propertyValue = "weblogic.jndi.WLInitialContextFactory"),
      @ActivationConfigProperty(propertyName = "provider-url",
      propertyValue = "t3://localhost:7001"),
                @ActivationConfigProperty(propertyName = "destinationJndiName",
                propertyValue = "jms/TesteTopic"),
                @ActivationConfigProperty(propertyName = "topicMessagesDistributionMode",
                propertyValue = "One-Copy-Per-Application"),
      @ActivationConfigProperty(propertyName = "jms-client-id",
      propertyValue = "MessageDrivenBean")
      })
      @TransactionManagement(TransactionManagementType.BEAN)
      public class MessageDrivenBean implements MessageListener {

      public void onMessage(Message message) {
      TextMessage msg = null;

      try {
      if (message instanceof TextMessage) {
      msg = (TextMessage) message;
      System.out.println
      ("MESSAGE BEAN: Message received: "
      + msg.getText());
      } else {
      System.out.println
      ("Message of wrong type: "
      + message.getClass().getName());
      }
      }

      catch (JMSException e) {e.printStackTrace();}
      catch (Throwable te) {te.printStackTrace();}
      }
      }

      ejb-jar.xml

      <?xml version = '1.0' encoding = 'windows-1252'?>
      <ejb-jar 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" xmlns="http://java.sun.com/xml/ns/javaee">
      <display-name>MessageDrivenBean</display-name>
      </ejb-jar>

      weblogic-jar.xml

      <?xml version = '1.0' encoding = 'windows-1252'?>
      <weblogic-ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar http://xmlns.oracle.com/weblogic/weblogic-ejb-jar/1.1/weblogic-ejb-jar.xsd"
      xmlns="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar">
      <weblogic-enterprise-bean>
      <ejb-name>MessageDrivenBean</ejb-name>
           <jndi-name>MessageDrivenBean</jndi-name>
      <local-jndi-name>weblogic.jndi.WLInitialContext</local-jndi-name>
           </weblogic-enterprise-bean>
      </weblogic-ejb-jar>

      What am I doing wrong?
      Thanks!

      Edited by: fe.mag on 26/03/2012 05:58
        • 1. Re: <Warning> <EJB> <BEA-010061>
          René van Wijk
          Did you create the topic with the JNDI - jms/TesteTopic, and did you target it to the server to which the application is deployed?

          You can check the JNDI tree of the server in question, if the resource is available on the particular server you are deploying the application to.

          The JNDI tree is present in the environment, servers, your_server
          • 2. Re: <Warning> <EJB> <BEA-010061>
            916271
            Hello René van Wijk!

            I checked the JNDI tree and this topic and the ConnectionFactory is there within the server.

            I am using JDeveloper and when I run the application appears as follows:

            *<26/03/2012 11h43min28s EDT> <Notice> <WebLogicServer> <BEA-000331> <Started "DefaultServer" WebLogic Admin Server is running in domain "DefaultDomain" Development Mode>*
            *<26/03/2012 11h43min28s EDT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>*
            *<26/03/2012 11h43min28s EDT> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>*

            But my settings were made in the domain "base_domain" with the server "Admin".
            Does it could be the problem?
            • 3. Re: <Warning> <EJB> <BEA-010061>
              916271
              Hi everybody!

              I found the solution for my problem.
              It is needed to configure JDeveloper to manage and to use the external domain of WebLogic, this way:

              (After creating a new domain through the "Configuration Wizard")

              * Right click in the Application Server Navigator and select New Application Server;
              * In the "Create Application Server Connection" window select Integrated Server and click Next;
              * Create a name for your server and check the option "Let JDeveloper manage the lifecycle for this Server Instance" to enable the fields of Domain Directory and Server Instance and define the address for each one, in my case:

              /Oracle/Middleware/user_projects/domains/base_domain
              /Oracle/Middleware/user_projects/domains/base_domain/servers/Admin

              * Next set the user and password of the domain. Click Next;
              * Set the configurations and click Finish.

              * Now, select Application >> Application Properties >> Run and select the server. Click ok.
              * Finally in the Application Server Navigator again right click in the server and Start Server Instance.

              It's this!