Monday, November 2, 2015

Applications showing warning due to MessageBufferBean and MessageBufferTopicBean while migrating projects from WebLogic 8.1 to 10.3

PROBLEM

While deploying WebLogic applications to cluster, the following warning messages are displayed in server logs.

<Jun 9, 2015 3:37:43 PM EDT> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 1 task for the application 'cluster-nur'.>
<Jun 9, 2015 3:43:42 PM EDT> <Warning> <EJB> <BEA-010061> <The Message-Driven EJB: MessageBufferTopicBean is unable to connect to the JMS destination: weblogic.test1.WlwRuntimeAppScopedJMS#MSG_B
UFFER_TOPIC. The Error was:
Can not get distribute destination information. The destination JNDI name is weblogic.test1.WlwRuntimeAppScopedJMS#MSG_BUFFER_TOPIC, the provider URL is null>
<Jun 9, 2015 3:43:42 PM EDT> <Warning> <EJB> <BEA-010061> <The Message-Driven EJB: MessageBufferBean is unable to connect to the JMS destination: weblogic.test1.WlwRuntimeAppScopedJMS#MSG_BUFFER
_QUEUE. The Error was:
Can not get distribute destination information. The destination JNDI name is weblogic.test1.WlwRuntimeAppScopedJMS#MSG_BUFFER_QUEUE, the provider URL is null>

Also the applications display Warning in console, to confirm the reason for warning go to click on application and go to monitoring tab as below.




CAUSE 

weblogic-application.xml  in the WebLogic applications has a reference to the library weblogic-controls-10.0. Because of which we get a additional MDBs from a jar file in this library (weblogic-
messagebuffer-mdb) that listen on a specific application-scoped queue and topic and as our application does not define these queues, the WebLogic will report a warning that these MDBs could not connect to their destination.

Below is weblogic-application.xml(inside TestEar.ear\META-INF\) of a sample test application which is using weblogic-controls-10.0. See highlighted.

<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-application xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-application" 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/javaee_5.xsd http://www.bea.com/ns/weblogic/weblogic-application http://www.bea.com/ns/weblogic/weblogic-application/1.0/weblogic-application.xsd">
    <!-- server-version: 10.3 -->
    <wls:ejb>
        <wls:start-mdbs-with-application>false</wls:start-mdbs-with-application>
    </wls:ejb>
    <wls:application-param>
        <wls:param-name>webapp.encoding.default</wls:param-name>
        <wls:param-value>UTF-8</wls:param-value>
    </wls:application-param>
    <wls:classloader-structure>
        <wls:classloader-structure>
            <wls:module-ref>
                <wls:module-uri>TestWeb.war</wls:module-uri>
            </wls:module-ref>
            <wls:classloader-structure>
                <wls:module-ref>
                    <wls:module-uri>TestWeb_WLI_ProjectBeans</wls:module-uri>
                </wls:module-ref>
            </wls:classloader-structure>
            <wls:classloader-structure>
                <wls:module-ref>
                    <wls:module-uri>TestWeb_WLI_ComponentBeans</wls:module-uri>
                </wls:module-ref>
            </wls:classloader-structure>
        </wls:classloader-structure>
    </wls:classloader-structure>
    <wls:listener>
        <wls:listener-class>com.bea.wli.management.WLIAppListener</wls:listener-class>
    </wls:listener>
    <wls:library-ref>
        <wls:library-name>beehive-controls-1.0.1-10.0</wls:library-name>
        <wls:specification-version>1.0</wls:specification-version>
        <wls:exact-match>true</wls:exact-match>
    </wls:library-ref>
    <wls:library-ref>
        <wls:library-name>sb-transport-control-10.0</wls:library-name>
        <wls:specification-version>10.0</wls:specification-version>
        <wls:exact-match>true</wls:exact-match>
    </wls:library-ref>
    <wls:library-ref>
        <wls:library-name>weblogic-controls-10.0</wls:library-name>
        <wls:specification-version>10.0</wls:specification-version>
        <wls:exact-match>true</wls:exact-match>
    </wls:library-ref>
    <wls:library-ref>
        <wls:library-name>wls-commonslogging-bridge</wls:library-name>
        <wls:specification-version>1.0</wls:specification-version>
        <wls:exact-match>true</wls:exact-match>
    </wls:library-ref>
</wls:weblogic-application>


These JMS destinations are created by the application when the MessageBuffer annotation is used and our applications are not using com.bea.control.annotations.MessageBuffer annotation which is why above error is thrown.  These created JMS elements are used in the following library:

-{BEA_HOME}\workshop_10.3\common\deployable-libraries\weblogic-controls-10.2.ear
-in APP-INF/lib/weblogic-controls.jar
-in weblogic-messagebuffer-mdb.jar, in META-INF, weblogic-ejb-jar.xml


where the following are noted:
WlwRuntimeAppScopedJMS#MSG_BUFFER_QUEUE
WlwRuntimeAppScopedJMS#MSG_BUFFER_TOPIC

Below is  weblogic-ejb-jar.xml of weblogic-controls-10.2.ear.See highlighted.

<?xml version="1.0" encoding="UTF-8"?>

<weblogic-ejb-jar xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.bea.com/ns/weblogic/90
    http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd"
    xmlns="http://www.bea.com/ns/weblogic/90"
    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee">

  <weblogic-enterprise-bean>
    <ejb-name>MessageBufferBean</ejb-name>

    <message-driven-descriptor>
      <pool>
        <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
      </pool>
    </message-driven-descriptor>

    <transaction-descriptor>
        <trans-timeout-seconds>300</trans-timeout-seconds>
    </transaction-descriptor>

    <dispatch-policy>controls_buffering_mdb_execute_queue</dispatch-policy>
  </weblogic-enterprise-bean>  

  <weblogic-enterprise-bean>
    <ejb-name>MessageBufferTopicBean</ejb-name>

    <message-driven-descriptor>
      <pool>
        <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
      </pool>
      <generate-unique-jms-client-id>true</generate-unique-jms-client-id>
      <durable-subscription-deletion>true</durable-subscription-deletion>
    </message-driven-descriptor>

    <transaction-descriptor>
        <trans-timeout-seconds>300</trans-timeout-seconds>
    </transaction-descriptor>

    <dispatch-policy>controls_buffering_mdb_execute_topic</dispatch-policy>
  </weblogic-enterprise-bean>  
  
  <message-destination-descriptor>
    <message-destination-name>MessageBufferInvokeQueue</message-destination-name>
    <destination-resource-link>WlwRuntimeAppScopedJMS#MSG_BUFFER_QUEUE</destination-resource-link>
  </message-destination-descriptor>
  <message-destination-descriptor>
    <message-destination-name>MessageBufferInvokeTopic</message-destination-name>
    <destination-resource-link>WlwRuntimeAppScopedJMS#MSG_BUFFER_TOPIC</destination-resource-link>
  </message-destination-descriptor>
</weblogic-ejb-jar>


Above is a known Oracle bug.


SOLUTION


Controls Message Buffering in a cluster requires submodule targeting.

If your application enables message buffering on controls use the annotation
'com.bea.control.annotations.MessageBuffer', you may have the following error when you try to deploy it on a cluster:"While attempting to create destination MSG_BUFFER_QUEUE in module
<name_of_your_ear>!WlwRuntimeAppScopedJMS the JMSServer of name <name_of_your_cluster> could not be found".


Workaround: 

In this case, you must target the MSG_BUFFER_QUEUE to a specific JMS Server with the following submoduletargets option to your weblogic.Deployer command:

-submoduletargets cgJMSServer@WlwRuntimeAppScopedJMS@WseeJmsServer_auto_1

Hope above helps in understanding the WebLogic behavior behind these warnings, please leave your feedback or query.

No comments:

Post a Comment