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:
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".Code:@Bean 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; } @Bean public ConnectionFactory tuxedoConnectionFactory() { LocalConnectionFactoryBean cf = new LocalConnectionFactoryBean(); cf.setManagedConnectionFactory(tuxedoManagedConnectionFactory()); try { cf.afterPropertiesSet(); } catch (ResourceException e) { System.out.println("Big problem after setting properties"); } return (ConnectionFactory) cf.getObject(); } @Bean public CciTemplate tuxedoTemplate() { CciTemplate t = new CciTemplate(); t.setConnectionFactory(tuxedoConnectionFactory()); return t; } @Bean public TuxedoCciDAO tuxedoDAO() { TuxedoCciDAO dao = new TuxedoCciDAO(); dao.setConnectionFactory(tuxedoConnectionFactory()); return dao; }
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:
How is the context deal with in a non-managed mode?Code: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


Reply With Quote
