We have a plain standalone spring application and we need to put jdbc datasource in jndi. (we use jboss treecache and it need datasource to be in the jndi).
Some go
I realize this is an old question, but there's a way to do this without custom code. It's fairly verbose, but 100% declarative.
java:comp/UserTransaction
another/jndi/name
literal_value
The MethodInvokingFactoryBean can also be used to set System properties (which comes in handy when using Atomikos), as long as the bean that reads the System properties depends-on that MethodInvokingFactoryBean.
true
true
com.atomikos.icatch.standalone.UserTransactionServiceFactory
/opt/txlogs