We are receiving a compilation error in the following code, while trying to set the targetConnectionFactory.
According to the example given in Spring 4 documentation for UserCredentialsConnectionFactoryAdapter, the setTargetConnectionFactory() method takes the object of JndiObjectFactoryBean as an argument. But, looks like the JndiObjectFactoryBean hasn't implemented the 'ConnectionFactory' interface, which is supposed to be the argument of this set method.
Is this any bug with Spring 4 ? if JndiObjectFactoryBean object cannot be set as targetConnectionFactory , then what can be used in it's place ?
JndiObjectFactoryBean theJndiObjectFactoryBean = new JndiObjectFactoryBean(); theJndiObjectFactoryBean.setJndiTemplate(getJNDITemplate()); theJndiObjectFactoryBean.setJndiName(jndiConnectionFactoryName); UserCredentialsConnectionFactoryAdapter theUserCredentialsConnectionFactoryAdapter = new UserCredentialsConnectionFactoryAdapter(); theUserCredentialsConnectionFactoryAdapter.setTargetConnectionFactory(theJndiObjectFactoryBean);