cxf-integration-jca module has implemented the JCA1.5 outbound connection. You can see samples in $CXF_HOME/samples/integration/jca.


The jca rar package structure would be:


Refer to this build.xml "generate.rar" target for building rar detail.

Deploy RAR to JBOSS.

Deploy the standalone RAR.

(Note: This has been tested against JBoss4.0.5)

  1. You need to put below jars in the $JBOSS_HOME/lib/endorsed.
    • geronimo-activation_1.1_spec-1.0-M1.jar
    • geronimo-annotation_1.0_spec-1.1.jar
    • geronimo-ws-metadata_2.0_spec-1.1.1.jar
    • jaxb-api-2.1.jar
    • jaxb-impl-2.1.4.jar
    • jaxb-xjc-2.1.4.jar
    • jsr181-api-1.0-MR1.jar
    • saaj-api-1.3.jar
    • saaj-impl-1.3.jar
    • stax-api-1.0.1.jar
    • stax-utils-20060502.jar
  2. Copy the rar to the $JBOSS_HOME/server/default
  3. Create the cxfj2ee_1_5-ds.xml as below, and copy it to $JBOSS_HOME/server/default
    <!DOCTYPE connection-factories
        PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"

You can refer to jca sample's README for detail.

Deploy the RAR in EAR.

(Note: This has been tested against JBoss4.0.5 and JBoss4.2.1)

  • Having application.xml
    <?xml version="1.0" encoding="UTF-8"?>
  • Having jboss-app.xml to configure the classloader.
    <?xml version="1.0" encoding="UTF-8"?>
  • Having cxf-ds for jca outbound in JBoss.
     <?xml version="1.0" encoding="UTF-8"?>

    The rar name should be full name, which is ear-name#rar-name, instead of rar-name alone.

  • put the application.xml and jboss-app.xml in the META-INF folder.
  • put the cxf.rar and the cxf-ds.xml in an EAR.
    • For the JBoss4.0.5, Need to put the geronimo-ws-metadata_2.0_spec-1.1.1.jar in the $JBOSS_HOME/lib/endorsed folder.
      Make sure the cxf.rar library does not contain xml-apis.jar and xml-resolver.jar.
    • For the JBoss4.2.1, Doesn't need to put any jars in the endorsed folder, but need to make sure cxf.rar library
      does not contain xml-api.jar.

Deploy RAR to Weblogic.

(Note: this has been tested against WebLogic9.1)

Package RAR in an EAR.

  • Add a weblogic-ra.xml in the META-INF folder.
    <weblogic-connector xmlns="">
  • Package the RAR in an EAR with application.xml.
  • Put the geronimo-ws-metadata_2.0_spec-1.1.1.jar in the $WebLogic_HOME/$JDK_Home/jre/lib/endorsed

Deploy RAR to WebSphere.


Using JCA Connection.

Get Connection from ManagedConnectionFactory.

Below is the code snippet to get the Connection.

        URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");                
        CXFConnectionRequestInfo cri = new CXFConnectionRequestInfo(Greeter.class, 
        ManagedConnectionFactory managedFactory = new ManagedConnectionFactoryImpl();
        Subject subject = new Subject();
        ManagedConnection mc = managedFactory.createManagedConnection(subject, cri);        
        Object o = mc.getConnection(subject, cri);

Also can get the connection without wsdl, but you need to provide the address.

        CXFConnectionRequestInfo requestInfo = new CXFConnectionRequestInfo();
        ManagedConnectionFactory factory = new ManagedConnectionFactoryImpl();
        ManagedConnection mc = factory.createManagedConnection(null, requestInfo);
        Object client = mc.getConnection(null, requestInfo);

Using CXF-JCA RAR to access the Stateless Session Bean.

By using cxf-jca RAR, the EIS is able to access the Stateless Session Bean by CXF Interal API or JAXWS API.
If you want to deploy the Stateless Session Bean, you need to modify the file.

Activate the file.

# Format: 
# jndi_name={namespace}ServiceName@url_to_swdl
# jndi_name: The JNDI name that an external client uses to contact the bean.
# ServiceName: The string form of the QName for the service in the WSDL file.
# @url_to_wsdl: The string form of a URL that identifies the WSDL file.
# Example:
# GreeterBean={}Greeter@file:c:/wsdl/hello_world.wsdl

You can specify the file location in the $RAR/META-INF/ra.xml "EJBServicePropertiesURL" property value.

You need to deploy the ejbs before activate the file, otherwise, it won't find the JNDI name.

  • No labels