Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Deploy CXF-JCA RAR.

Build CXF-JCA RAR

The jca rar package structure would be:

No Format

    |---META-INF
    |---META-INF/ra.xml
    |---cxf-api-2.1-incubator.jar
    |---cxf-integration-jca-2.1-incubator.jar
    |---.....
    

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

Deploy RAR to JBOSS.

  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
    Code Block
    <code>

...

  1. xml
    xml
    
    <!DOCTYPE connection-factories
        PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
        "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
    <connection-factories>
      <no-tx-connection-factory>
        <jndi-name>CXFConnector</jndi-name>
        <rar-name>cxf.rar</rar-name>
        <connection-definition>org.apache.cxf.connector.CXFConnectionFactory</connection-definition>
      </no-tx-connection-factory>
    </connection-factories>
    

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

...

Using JCA Connection.

Get JCA Connection from ManagedConnectionFactory.

Below is the code snippet to get the Connection.

Code Block
java
java


        URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");                
        CXFConnectionRequestInfo cri = new CXFConnectionRequestInfo(Greeter.class, 
                                           wsdl,
                                           serviceName,
                                           portName);
        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.

Code Block
java
java


        CXFConnectionRequestInfo requestInfo = new CXFConnectionRequestInfo();
        requestInfo.setInterface(Greeter.class);
        requestInfo.setAddress("http://localhost:9000/SoapContext/SoapPort");
        
        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 ejb_servant.properties file.
The properties file format is: