Problem migrating Tibco usage from JBoss 5 to JBoss EAP 6.4

265 views
Skip to first unread message

Jacob Willig

unread,
May 3, 2017, 8:23:32 AM5/3/17
to Generic JMS JCA Resource Adapter for JBoss AS
I have tried to migrate my EARs using Tibco messaging from JBoss 5 to 6.4.
For this I configured the Generic JMS JCA Resource Adaptor, but I now get the following stacktrace:

13:00:17,376 WARN  [org.jboss.resource.adapter.jms.inflow.JmsActivation] (default-threads - 5) Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@1be9463(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@690399e destination=java:/TIBCOJMSProvider/ES.sendUpdateEmployee.dctm destinationType=javax.jms.Destination acknowledgeMode=Auto-acknowledge subscriptionDurability=false reconnectInterval=10 reconnectAttempts=-1 user=admin password=<not shown> maxMessages=1 minSession=1 maxSession=15 connectionFactory=jms/tibcoCF): java.lang.ClassCastException: org.jboss.resource.adapter.jms.JmsConnectionFactoryImpl cannot be cast to javax.jms.XAConnectionFactory
 at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupConnection(JmsActivation.java:437) [generic-jms-ra-jar-1.0.8.Final-redhat-1.jar:1.0.8.Final-redhat-1]
 at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupConnection(JmsActivation.java:414) [generic-jms-ra-jar-1.0.8.Final-redhat-1.jar:1.0.8.Final-redhat-1]
 at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupActivation(JmsActivation.java:313) [generic-jms-ra-jar-1.0.8.Final-redhat-1.jar:1.0.8.Final-redhat-1]
 at org.jboss.resource.adapter.jms.inflow.JmsActivation.access$100(JmsActivation.java:57) [generic-jms-ra-jar-1.0.8.Final-redhat-1.jar:1.0.8.Final-redhat-1]
 at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:543) [generic-jms-ra-jar-1.0.8.Final-redhat-1.jar:1.0.8.Final-redhat-1]
 at org.jboss.jca.core.workmanager.WorkWrapper.run(WorkWrapper.java:215)
 at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)
 at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808)
 at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)
 at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:828)
 at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_121]
 at org.jboss.threads.JBossThread.run(JBossThread.java:122)

I tried with tibjms.jar (version 5 and 8.3).

Clearly I am missing something obvious, but I am currently at a loss and need some guidance.
I did read several related threads with similar issues, but I failed to properly understand their solutions and explanations of how all is connected.
my standalone.xml and one of the ejb-jar.xml's is attached.

Please Note: If I disconnect the networkconnection to server, I get a message indicating this unavailability, so clearly some type of connection is being setup..

any help is greatly appreciated.

Kind regards,

Jacob Willig
standalone.xml
ejb-jar.xml

Jacob Willig

unread,
May 3, 2017, 8:31:19 AM5/3/17
to Generic JMS JCA Resource Adapter for JBoss AS
The related server.log of a startup
server.log

Justin Bertram

unread,
May 3, 2017, 8:58:10 AM5/3/17
to Generic JMS JCA Resource Adapter for JBoss AS
Based on the stack-trace it appears the connection from Wildfly to Tibco is being made as expected. However, once the connection is made and the JCA RA looks up the connection factory (i.e. "jms/tibcoCF") from Tibco it fails to cast the connection factory to an XAConnectionFactory.  It's trying to cast to XAConnectionFactory because your MDB is configured for transactional delivery.  My guess is that the connection factory your looking up from Tibco isn't configured or implemented to support XA.  You can read more about this in the documentation.

Jacob Willig

unread,
May 3, 2017, 9:26:19 AM5/3/17
to Generic JMS JCA Resource Adapter for JBoss AS
If I open tibjms.jar I do see XAFactory related classes.
Also in standalone.xml I specifically mentioned <transaction-support>NoTransaction</transaction-support>:

        <subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">
            <resource-adapters>
                <resource-adapter id="generic-jms-ra.rar">
                    <module slot="main" id="org.jboss.genericjms"/>
                    <transaction-support>NoTransaction</transaction-support>
                    <!--
                     <transaction-support>XATransaction</transaction-support>
                    -->
                    <connection-definitions>
                        <connection-definition class-name="org.jboss.resource.adapter.jms.JmsManagedConnectionFactory" jndi-name="jms/tibcoCF"  enabled="true" use-java-context="true" pool-name="tibcoCF" use-ccm="true">
                            <config-property name="JndiParameters">
                                java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory;java.naming.provider.url=tcp://server1:20250
                            </config-property>
                            <config-property name="ConnectionFactory">
                                tibcoCF
                            </config-property>
                            <security>
                                <application/>
                            </security>
                        </connection-definition>
                    </connection-definitions>
                </resource-adapter>
            </resource-adapters>
        </subsystem>


Is there something I would need to configure somewhere else?

Justin Bertram

unread,
May 3, 2017, 9:41:13 AM5/3/17
to Generic JMS JCA Resource Adapter for JBoss AS
If I open tibjms.jar I do see XAFactory related classes.
 
That gives an indication that Tibco's JMS client implementation supports XA transactions, but that doesn't necessarily mean that the connection factory the MDB is looking up is properly configured for XA. You'd have to consult Tibco for more details on that front.


Also in standalone.xml I specifically mentioned <transaction-support>NoTransaction</transaction-support>
 
You're only configuring the outbound connector with that bit of XML.  To change the transaction semantics of the MDB you'd need to change the MDB itself.  This is discussed in the documentation I linked previously.

Jacob Willig

unread,
May 3, 2017, 10:15:33 AM5/3/17
to Generic JMS JCA Resource Adapter for JBoss AS
Ok, I added jndiParameters:

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="3.0" 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">
  <display-name>UpdateEmployee listener</display-name>
  <enterprise-beans>
      <message-driven>
      <display-name>UpdateEmployeeEJB</display-name>
      <ejb-name>UpdateEmployeeEJB</ejb-name>
      <ejb-class>nl.enexis.pdossier.ejb.UpdateEmployeeEJB</ejb-class>
      <transaction-type>Container</transaction-type>
 <activation-config>
      <activation-config-property>
       <activation-config-property-name>destination</activation-config-property-name>
       <activation-config-property-value>ES.sendUpdateEmployee.dctm</activation-config-property-value>
      </activation-config-property>
      <activation-config-property>
       <activation-config-property-name>connectionFactory</activation-config-property-name>
       <activation-config-property-value>jms/tibcoCF</activation-config-property-value>
      </activation-config-property>
      <activation-config-property>
       <activation-config-property-name>jndiParameters</activation-config-property-name>
       <activation-config-property-value>java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory;java.naming.factory.url.pkgs=com.tibco.tibjms.naming;java.naming.provider.url=tcp://server1:20250</activation-config-property-value>
      </activation-config-property>
      <activation-config-property>
       <activation-config-property-name>user</activation-config-property-name>
       <activation-config-property-value>admin</activation-config-property-value>
      </activation-config-property>
      <activation-config-property>
       <activation-config-property-name>password</activation-config-property-name>
       <activation-config-property-value></activation-config-property-value>
      </activation-config-property>
      </activation-config>
      </message-driven>
  </enterprise-beans>
</ejb-jar>

 and it now gives me this exception:

16:13:08,005 WARN  [org.jboss.resource.adapter.jms.inflow.JmsActivation] (default-threads - 6) Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@91c161(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@7743d92 destination=ES.sendUpdateEmployee.dctm destinationType=javax.jms.Destination acknowledgeMode=Auto-acknowledge subscriptionDurability=false reconnectInterval=10 reconnectAttempts=-1 user=admin password=<not shown> maxMessages=1 minSession=1 maxSession=15 connectionFactory=jms/tibcoCF jndiParameters={java.naming.provider.url=tcp://server1:20250, java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory, java.naming.factory.url.pkgs=com.tibco.tibjms.naming}): javax.naming.NameNotFoundException: Name not found: 'jms/tibcoCF'
 at com.tibco.tibjms.naming.TibjmsContext.lookup(TibjmsContext.java:715) [tibjms.jar:8.3.0]
 at com.tibco.tibjms.naming.TibjmsContext.lookup(TibjmsContext.java:491) [tibjms.jar:8.3.0]
 at javax.naming.InitialContext.lookup(Unknown Source) [rt.jar:1.8.0_121]
 at javax.naming.InitialContext.lookup(Unknown Source) [rt.jar:1.8.0_121]
 at org.jboss.resource.adapter.jms.inflow.JmsActivation.lookup(JmsActivation.java:562) [generic-jms-ra-jar-1.0.8.Final-redhat-1.jar:1.0.8.Final-redhat-1]
 at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupConnection(JmsActivation.java:432) [generic-jms-ra-jar-1.0.8.Final-redhat-1.jar:1.0.8.Final-redhat-1]

Justin Bertram

unread,
May 3, 2017, 10:22:55 AM5/3/17
to Generic JMS JCA Resource Adapter for JBoss AS
This latest exception indicates the JNDI name you're using to look-up the connection factory (i.e. "jms/tibcoCF") can't be found on the Tibco server.  Please confirm you're using the proper JNDI name.

Jacob Willig

unread,
May 3, 2017, 10:40:52 AM5/3/17
to Generic JMS JCA Resource Adapter for JBoss AS
Ok, I am not sure what the proper value should be then.

This is what the jboss.xml was for this EAR working on JBoss5.1

<?xml version="1.0" encoding="utf-8"?>
<jboss xmlns:xs="http://www.jboss.org/j2ee/schema"
       xs:schemaLocation="http://www.jboss.org/j2ee/schema jboss_5_0.xsd"
             version="5.0">
   <enterprise-beans>
      <message-driven>
         <ejb-name>UpdateEmployeeEJB</ejb-name>
   <destination-jndi-name>ES.sendUpdateEmployee.dctm</destination-jndi-name>
 <activation-config>
      <activation-config-property>
       <activation-config-property-name>providerAdapterJNDI</activation-config-property-name>
       <activation-config-property-value>java:/TIBCOJMSProvider</activation-config-property-value>

      </activation-config-property>
      <activation-config-property>
       <activation-config-property-name>user</activation-config-property-name>
       <activation-config-property-value>DOCUMENTUM</activation-config-property-value>

      </activation-config-property>
      <activation-config-property>
       <activation-config-property-name>password</activation-config-property-name>
       <activation-config-property-value></activation-config-property-value>
      </activation-config-property>
      <activation-config-property>
       <activation-config-property-name>dLQJNDIName</activation-config-property-name>

       <activation-config-property-value>ES.sendUpdateEmployee.dctm</activation-config-property-value>
      </activation-config-property>
      <activation-config-property>
       <activation-config-property-name>DLQUser</activation-config-property-name>
       <activation-config-property-value>DOCUMENTUM</activation-config-property-value>
      </activation-config-property>
      <activation-config-property>
       <activation-config-property-name>DLQPassword</activation-config-property-name>

       <activation-config-property-value></activation-config-property-value>
      </activation-config-property>
      </activation-config>
      </message-driven>
   </enterprise-beans>
</jboss>


Does this give a clue, or is there somewhere else I could look in the old 5.1 environment?
I tried:
- java:/TIBCOJMSProvider
- TIBCOJMSProvider

But both gave also NameNotFound.

Justin Bertram

unread,
May 3, 2017, 11:15:55 AM5/3/17
to Generic JMS JCA Resource Adapter for JBoss AS
...is there somewhere else I could look in the old 5.1 environment?

Yes.  You need to look at the actual definition of the TIBCOJMSProvider.  That should contain the connection factory JNDI name used by the provider for the integration.

Justin Bertram

unread,
May 3, 2017, 11:19:41 AM5/3/17
to Generic JMS JCA Resource Adapter for JBoss AS
It's worth remembering that "connection-definition" in standalone.xml is for the outbound connector.  It's not related to how the MDB makes its connection and consumes its messages.  All the configuration for the MDB should be done on the MDB itself (or its deployment descriptor).  It looks to me like you've been mixing the two together (with predictably bad results).

Jacob Willig

unread,
May 8, 2017, 8:03:39 AM5/8/17
to Generic JMS JCA Resource Adapter for JBoss AS

Hi Justin,


First of all, thanks a lot for all the help and quick responses!

Sorry for being a noob at this, but I think I am getting a better understanding with your help.

Let me summerize how I understand it now, please correct me where I am wrong:


So most importantly there is an important distinction between Inbound and Outbound messaging:

- Outbound uses the configuration in the standalone.xml

- Inbound uses the definition in deployment decriptors. I guess that would be ejb-jar.xml located in the META-INF of the ear file?!


To get the interconnections right I will explain how everything now seems connected:


My MessageListener Class:

------------------------------------

@MessageDriven(messageListenerInterface=MessageListener.class, name="UpdateEmployeeEJB")

public class UpdateEmployeeEJB extends AbstractDctmConnectionEJB<Employees, IDfSession, JmsMDBConnection>{


super class:

public abstract class AbstractDctmConnectionEJB<R extends Object, C extends IDfSession, JMS extends JmsMDBConnection> extends AbstractConnectionEJB<R, IDfSession, JMS>{


super-super class:

public abstract class AbstractConnectionEJB<R extends Object, C extends Object, JMS extends JmsMDBConnection> implements MessageListener {

------------------------------------


I guess (name="UpdateEmployeeEJB") refers to the (<ejb-name>UpdateEmployeeEJB</ejb-name>) definition in ejb-jar.xml -->
----------------------------------------


<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="3.0" 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">
  <display-name>UpdateEmployee listener</display-name>
  <enterprise-beans>
      <message-driven>
      <display-name>UpdateEmployeeEJB</display-name>
      <ejb-name>UpdateEmployeeEJB</ejb-name>

      <ejb-class>nl.elexis.pdossier.ejb.UpdateEmployeeEJB</ejb-class>


      <transaction-type>Container</transaction-type>
 <activation-config>
      <activation-config-property>

       <activation-config-property-name>destination</activation-config-property-name>


       <activation-config-property-value>ES.sendUpdateEmployee.dctm</activation-config-property-value>
      </activation-config-property>
      <activation-config-property>

       <activation-config-property-name>connectionFactory</activation-config-property-name>
       <activation-config-property-value>tibco</activation-config-property-value>


      </activation-config-property>
      <activation-config-property>
       <activation-config-property-name>jndiParameters</activation-config-property-name>

       <activation-config-property-value>java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory;java.naming.factory.url.pkgs=com.tibco.tibjms.naming;java.naming.provider.url=tcp://server1:20250</activation-config-property-value>


      </activation-config-property>
      <activation-config-property>
       <activation-config-property-name>user</activation-config-property-name>

       <activation-config-property-value>admin</activation-config-property-value>


      </activation-config-property>
      <activation-config-property>
       <activation-config-property-name>password</activation-config-property-name>
       <activation-config-property-value></activation-config-property-value>
      </activation-config-property>

      </activation-config>
      </message-driven>
  </enterprise-beans>
</ejb-jar>
----------------------------------------

From there I guess the jndiParameters provide the factory to load/use? In this case the Tibco JMS Factory...
I guess the (destination) value points to the name of the queue as known by the Tibco server (server1 listing on port 20250)?
what I do not yet understand is where the (connectionFactory) value should point to...

best regards,

Jacob

Justin Bertram

unread,
May 8, 2017, 11:54:39 AM5/8/17
to Generic JMS JCA Resource Adapter for JBoss AS
 Inbound uses the definition in deployment decriptors. I guess that would be ejb-jar.xml located in the META-INF of the ear file?!

Inbound would use the configuration from the deployment descriptor (typically in the EJB jar file's META-INF directory) or from the annotations on the MDB. Typically deployments will use one or the other, but you are apparently using a mix of both (i.e. using ejb-jar.xml and @MessageDriven)


From there I guess the jndiParameters provide the factory to load/use?

As the documentation states, the "jndiParameters" activation configuration property is "the JNDI parameters used to perform the lookup of the destination and the connectionFactory."


I guess the (destination) value points to the name of the queue as known by the Tibco server (server1 listing on port 20250)?

That's correct.


 what I do not yet understand is where the (connectionFactory) value should point to...

As the documentation states, the "connectionFactory" activation configuration property is "the JNDI name of connection factory which the RA will use to consume the messages; this is normally a connection factory which supports XA." In your case (as with the destination) this would be a connection factory from the Tibco server since that's where your "jndiParameters" are pointing.

I think the simplest way to think about the configuration is that the RA exposes all the normal configuration elements that a normal, remote JMS client would need (i.e. provide JNDI properties to an InitialContext implementation then use the InitialContext to lookup a JMS connection factory and destination). It's really straight-forward.
Reply all
Reply to author
Forward
0 new messages