WS-RM persistence with RMTxStore does not work with JNDI Lookup in CXF

Solution Verified - Updated -

Issue

  • For our scenarios all WS-RM Features have to work inside JBoss EAP, both as a client (wrapped by an SLSB) and as a provider.
    The issue occurs with our working example after configuring the persistent store for WS-RM.

  • org.apache.cxf.ws.rm.persistence.jdbc.RMTxStore does not work with a JNDI datasource in JBoss EAP.

  • Here's what we are doing to reproduce this,

    • cretae a new empty database schema
    • configure a JNDI Datasource within JBoss EAP that uses the schema
    • Use the configuration in the xml file below,
    • See what happens.....
  • This is the xml file,

        <cxf:bus>
        <cxf:features>
            <cxf:logging ></cxf:logging>
            <wsa:addressing ></wsa:addressing>
            <!-- http://cxf.apache.org/schemas/configuration/wsrm-manager-types.xsd -->
            <wsrm-mgr:reliableMessaging ></wsrm>
        </cxf:features>
    </cxf:bus>

    <wsrm-mgr:rmManager id="org.apache.cxf.ws.rm.RMManager">
        <wsrm-mgr:deliveryAssurance>
            <wsrm-mgr:ExactlyOnce ></wsrm>
            <wsrm-mgr:InOrder ></wsrm>
        </wsrm-mgr:deliveryAssurance>
        <wsrm-mgr:sourcePolicy includeOffer="false" ></wsrm>
        <wsrm-mgr:store>
            <ref bean="myClientStore" ></ref>
        </wsrm-mgr:store>
    </wsrm-mgr:rmManager>

    <jee:jndi-lookup id="client_dataSource_jndi" jndi-name="java:jboss/datasources/myDS" resource-ref="true" expected-type="javax.sql.DataSource" ></jee:jndi>

    <!-- the original implementation does not work within an application server using a JNDI datasource
    <bean id="myClientStore" class="org.apache.cxf.ws.rm.persistence.jdbc.RMTxStore">
        <property name="dataSource" ref="client_dataSource_jndi" ></property>       
    </bean>
    -->
    <bean id="myClientStore" class="com.redhat.test.RMTxStoreWithJndiDs">
        <property name="dataSource" ref="client_dataSource_jndi" ></property>       
    </bean>

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x
  • JBossWS-CXF
  • Apache CXF

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content