1

We are migrating an application from Weblogic 10 to Weblogic 12. For some reason we cannot connect to a foreign JMS Topic and the only information we get after deployment of the EAR in our DEV environment is

ClassCastException: weblogic.jms.client.JMSConnection cannot be cast to weblogic.jms.client.JMSXAConnection

In the ACC environment we get another (but somewhat similar exception)

[EJB:015027]The Message-Driven EJB is transactional, but the JMS connection factory referenced by the JNDI name aaa.ChangeSignalConnectionFactory is not a JMS XA connection factory.>

Both environments run Weblogic 12.1.3.0.0

The same configuration worked perfectly on Weblogic 10 before the migration from Weblogic 10 (and Java6 + OpenJPA1) to Weblogic 12 (and Java7 + OpenJPA2)

Our MDB now looks like this (no annotations or anything, it's just an empty shell that does nothing at all and even this doesn't work)

  public class SignalConsumerMDB implements MessageListener {

  @Override
  public void onMessage(Message message) {

  }
}

The ejb-jar.xml looks like this

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
         version="3.0">
    <enterprise-beans>
        <message-driven>
            <ejb-name>SignalConsumerMDB</ejb-name>
            <ejb-class>a.b.c.SignalConsumerMDB</ejb-class>
            <transaction-type>Bean</transaction-type>
            <activation-config>
                <activation-config-property>
                    <activation-config-property-name>acknowledgeMode</activation-config-property-name>
                    <activation-config-property-value>Auto-acknowledge</activation-config-property-value>
                </activation-config-property>
                <activation-config-property>
                    <activation-config-property-name>destinationType</activation-config-property-name>
                    <activation-config-property-value>javax.jms.Topic</activation-config-property-value>
                </activation-config-property>
                <activation-config-property>
                    <activation-config-property-name>subscriptionDurability</activation-config-property-name>
                    <activation-config-property-value>Durable</activation-config-property-value>
                </activation-config-property>
                <activation-config-property>
                    <activation-config-property-name>topicMessagesDistributionMode</activation-config-property-name>
                    <activation-config-property-value>One-Copy-Per-Application</activation-config-property-value>
                </activation-config-property>
                <activation-config-property>
                    <activation-config-property-name>distributedDestinationConnection</activation-config-property-name>
                    <activation-config-property-value>LocalOnly</activation-config-property-value>
                </activation-config-property>
                <activation-config-property>
                    <activation-config-property-name>messageSelector</activation-config-property-name>
                    <activation-config-property-value>SignalType in ('a','b','c')</activation-config-property-value>
                </activation-config-property>
           </activation-config>
        </message-driven>
    </enterprise-beans>
    <assembly-descriptor>
        <security-role>
            <role-name>batchRole</role-name>
        </security-role>
    </assembly-descriptor>
</ejb-jar>

The weblogic-ejb-jar.xml looks like this (only the MDB is shown here)

<weblogic-enterprise-bean>
     <ejb-name>SignalConsumerMDB</ejb-name>
     <message-driven-descriptor>
         <destination-jndi-name>foreign.aaa.ChangeSignal</destination-jndi-name>
         <connection-factory-jndi-name>foreign.aaa.ChangeSignalConnectionFactory</connection-factory-jndi-name>
     </message-driven-descriptor>
 </weblogic-enterprise-bean>

Our database datasources uses the com.ibm.db2.jcc.DB2Driver (non-xa) driver and Supports Global Transactions is disabled in the weblogic console.

Our persistence.xml looks like this

<persistence-unit name="aaa" transaction-type="JTA">
    <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
    <jta-data-source>ABCDataSource</jta-data-source>
    <properties>
        <property name="connection.driver_class" value="com.ibm.db2.jcc.DB2Driver" />
        <property name="openjpa.TransactionMode" value="managed" />
        <property name="openjpa.ManagedRuntime" value="jndi(TransactionManagerName=javax.transaction.TransactionManager)" />
        <property name="openjpa.Log" value="DefaultLevel=${openjpa.log.level}, Runtime=${openjpa.log.level}, Tool=${openjpa.log.level}, SQL=${openjpa.sql.level}" />
        <property name="openjpa.Compatibility" value="CheckDatabaseForCascadePersistToDetachedEntity=true" />
        <property name="openjpa.jdbc.DBDictionary" value="db2(MaxColumnNameLength=38)"/>    
    </properties>
</persistence-unit>

The weblogic debug output for JMS is

DDMemberInformation : 
  DD Type                          = javax.jms.Topic
 DD ForwardingPolicy              = 1
  DD Config Name                   = aaa.ChangeSignal!ChangeSignalDistributed
  DD JNDI Name                     = aaa.ChangeSignal
  DD Member JNDI Name              = JMSapp4Zjavad011@aaa.ChangeSignal
  DD Member Name                   = aaa.ChangeSignal!JMSapp4Zjavad011@ChangeSignalDistributed
  DD Member Consumption Paused     = false
  DD Member Insertion Paused       = false
  DD Member Production Paused      = false
  DD Member Local JNDI Name        = null
  DD Member Server Name            = app4Zjavad011
  DD Member Cluster Name           = app1Cluster
  DD Member Migratable Target Name = null
  DD Member Domain Name            = wldev81domain
  DD Member AdvancedTopicSupported = true

####<Apr 21, 2017 10:19:56 AM CEST> <Debug> <JMSCDS> <zjavad12> <app1Zjavad121> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1492762796912> <BEA-000000> <Entry[1] = aaa.ChangeSignal!JMSapp1Zjavad011@ChangeSignalDistributed:  with destination id <4007994051863776153.25>: 
DDMemberInformation : 
  DD Type                          = javax.jms.Topic
 DD ForwardingPolicy              = 1
  DD Config Name                   = aaa.ChangeSignal!ChangeSignalDistributed
  DD JNDI Name                     = aaa.ChangeSignal
  DD Member JNDI Name              = JMSapp1Zjavad011@aaa.ChangeSignal
  DD Member Name                   = aaa.ChangeSignal!JMSapp1Zjavad011@ChangeSignalDistributed
  DD Member Consumption Paused     = false
  DD Member Insertion Paused       = false
  DD Member Production Paused      = false
  DD Member Local JNDI Name        = null
  DD Member Server Name            = app1Zjavad011
  DD Member Cluster Name           = app1Cluster
  DD Member Migratable Target Name = null
  DD Member Domain Name            = wldev81domain
  DD Member AdvancedTopicSupported = true
P_W999
  • 1,017
  • 12
  • 26
  • After a long weekend the MDB automatically connected to the remote topic. We still don't know why Weblogic12 considered the MDB as transactional and Weblogic10 did not. It might be caused by the fact that the remote topic was briefly configured with an XA connection factory but we'll never now. It's also possible that weblogic caches connections and thus *always* returned the XA connection even though we didn't need or want one. Cleaning all caches and rebooting both ends *might* resolve the weekend (otherwise wait for another long weekend =) ) – P_W999 May 06 '17 at 13:53

0 Answers0