1 Reply Latest reply: Jan 5, 2011 2:39 PM by 828808 RSS

    JCA connection factory and JNDI name

    828808
      I am developing a JCA resource adapter and I am stuck on how to create a connection factory from a client EJB or servlet. I want to do something like:

      javax.naming.Context ic = new javax.naming.InitialContext();
      javax.resource.cci.ConnectionFactory cf = (javax.resource.cci.ConnectionFactory)ic.lookup("jca/testJCA");

      But where or how do I associate the JNDI name "jca/testJCA" to the connection factory implementation class specified in ra.xml?

      I am using JDeveloper 11g and its integrated WebLogic app server for development.

      Thanks for any help - Roland Martin
        • 1. Re: JCA connection factory and JNDI name
          828808
          I found the answer in the following:

          http://cxf.apache.org/docs/using-cxf-jca-rar-in-application-server.html

          Updated weblogic-ra.xml with:

          <weblogic-connector
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://www.bea.com/ns/weblogic/90/weblogic-ra.xsd"
          xmlns="http://www.bea.com/ns/weblogic/weblogic-connector">
          <jndi-name>jca/testRA</jndi-name>
          <enable-access-outside-app>true</enable-access-outside-app>
          <outbound-resource-adapter>
          <connection-definition-group>
          *<connection-factory-interface>javax.resource.cci.ConnectionFactory</connection-factory-interface>*
          <connection-instance>
          *<jndi-name>jca/testJCA</jndi-name>*
          </connection-instance>
          </connection-definition-group>
          </outbound-resource-adapter>
          </weblogic-connector>

          Roland Martin