Announcement Announcement Module
No announcement yet.
JCA Tuxedo adapter with Spring JCA CCI Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • JCA Tuxedo adapter with Spring JCA CCI

    Using Spring 3.2.0 and trying to get my feet wet with JCA CCI....

    Never programmed against JCA before but got the general gist. Trying to wrap a JCA adapter against Tuxedo (ATMI C/C++) and Oracle documents only deploying their RAR package inside a container. Looking to get it going in non-managed mode.

    Uses config annotations and the major bean seems to be the LocalConnectionFactoryBean that houses the ConnectionFactory used by the CciTemplate. The Tuxedo adapter works with direct Record objects only. I got:
    	public TuxedoManagedConnectionFactory tuxedoManagedConnectionFactory() {
    		(setup the Resource Adapter here and add it to a singleton that the managed factory gets at)
    		TuxedoManagedConnectionFactory mcf = new TuxedoManagedConnectionFactory();
    		return mcf;
    	public ConnectionFactory tuxedoConnectionFactory() {
    		LocalConnectionFactoryBean cf = new LocalConnectionFactoryBean();
    		try {
    		} catch (ResourceException e) {
    			System.out.println("Big problem after setting properties");
    		return (ConnectionFactory) cf.getObject();
    	public CciTemplate tuxedoTemplate() {
    		CciTemplate t = new CciTemplate();
    		return t;
    	public TuxedoCciDAO tuxedoDAO() {
    		TuxedoCciDAO dao = new TuxedoCciDAO();
    		return dao;
    Not sure I can handling the LocalConnectionFactoryBean correctly? The afterSetPropertiesmethod isn't executed automatically (assuming it is alright to fire it manually). Was also surprised that the Cci template doesn't swallow the LocalConnectionFactoryBean but rather than via the "getObject".

    Anyways, the main problem is that when my resource adapter (for some reason) needs to get at the context to "createSubcontext" a NamingException is thrown:
    Naming exception error: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
    How is the context deal with in a non-managed mode?

  • #2
    converting a ra.xml file, maybe some help

    Thought some info from the supplied ra.xml file from Oracle might help somebody point in the right directions...

    The ra.xml starts off with:
        ..... (bunch of config properties)
    Programmatically I can push the majority of the configuration properties directly into the resource adapater (TuxedoClientSideResourceAdapter) which gets registered to a Tuxedo supervisor which from the code looks like it makes it accessible from the manager connection factory (first bean i listed in my original post). Will try to find a way to configuration with XML. That might help me find the right setup. Feels right now that I am programmatically by-passing stuff.

    Would love to here back from somebody that has refactored a ra.xml file either with the XML configuration or annotations.


    • #3
      The application gets at the ConnectionFactory via CciTemplate which is how one gets a connection and kicks off the ConnectionManager behind the scenes. But doesn't the resource adapter need to be registered in non-managed mode? Like with the ResourceAdapterFactoryBean where the afterSetProperties starts the RA? Think I get the basic flow of application call:
      where the CF (Connection Factory) does a get on the connection and issues an allocate connection on the CM (Connection Manager). Via the CM one should get the ManagedConnection (MC) and context stuff (provided by the RA). This is where I get lost.