Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JCA adapter with Spring JCA CCI

young_matthewd-759774Oct 18 2012 — edited Oct 24 2012
Using Tuxedo JCA adapter (12.1.1) on Java 1.6_20 and Spring 3.2.0.....

Want to get the Tuxedo adapter going outside a container in Spring via the Spring JCA CCI (http://static.springsource.org/spring/docs/3.2.0.M2/reference/html/cci.html). Not much experience with JCA but got the basic idea.

The resource adapter is the glue for the domain configuration, debug levels and so forth. Started by using the TuxedoClientSideResourceAdapter and registering it to the TuxedoAdapterSupervisor singleton that is used by the TuxedoManagedConnectionFactory. Spring JCA CCI represents the local connection factory inside the LocalConnectionFactoryBean which needs the TuxedoConnectionFactory built by the TuxedoManagedConnectionFactory:
        @Bean
	public TuxedoManagedConnectionFactory tuxedoManagedConnectionFactory() {
		TuxedoClientSideResourceAdapter ra = new TuxedoClientSideResourceAdapter();
		.... (set ra all debugs to true)
		ra.setTraceLevel("100000");
		ra.setLocalAccessPointSpec("//INV000000121176:7001/domainId=matthew");
		ra.setRemoteAccessPointSpec("//vsgtu817.sfa.se:48172/domainId=TR817TU");

		try {
			TuxedoAdapterSupervisor.getInstance().registerClientSideResourceAdapter(ra);
		} catch (ResourceAdapterInternalException e) {
			System.out.println("Big problem setting resource adapter");
		}
		
		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();
	}
What I am baffled by is that the tracing isn't getting hundred percent. For example I get:
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1fe1feb: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,applicationConfig,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,tuxedoManagedConnectionFactory,tuxedoConnectionFactory,tuxedoTransactionManager,tuxedoTemplate,tuxedoDAO]; root of factory hierarchy
2012-10-18:14:16:03:10:INFO[TuxedoAdapterSupervisor,registerClientSideResourceAdapter]TJA_0220:Tuxedo JCA Adapter, release 12c(12.1.1), resource archive version 1.4.0.0, build date: June 27 2012.
2012-10-18:14:16:03:10:ERROR[TJAService,TJAService]TJA_0072: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
2012-10-18:14:16:03:10:INFO[TuxedoAdapterSupervisor,createRemoteAccessPoints#2]TJA_0201:INFO: RemoteAccessPoint TR817TU created.
Expected to see more detailed information about what is going on in the TJASerivce when setting up the context. Which isn't happening due to how I am not correctly rigging Spring. So how to get tracing/debug working? Or can it be that printing via the JUL logger isn't working. Got in my logging.properties file FINEST on everything oracle and weblogic.

Love to see if anybody has built up JCA outside a container!?

Comments

Gaz in Oz

Please post a runnable example program plus table creation sql.

Please post input/output of the program showing the "error

Please also supply db version (4 digits), client and server OS version and architecture.

Any other information that may beuseful to re-create what you are seeing and doing.

Christopher Jones-Oracle

Can you post at https://github.com/oracle/node-oracledb/issues  and include the info that @"Gaz in Oz" requested?

A general note to people reading this thread: Node.js's number range is limited so you may need to fetch numbers as strings and use a 3rd party module such as bigint to handle them 'properly'.  Some details are in https://github.com/oracle/node-oracledb/issues/842 .  Perhaps a better general recommendation is to do all number calculations in SQL or PL/SQL.

node-oracledb 2.1 is out with the specific regression fixed.  My earlier comments about Node.js's number range still apply, of course.

1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 21 2012
Added on Oct 18 2012
5 comments
2,107 views