I have a JPA application that has specified JTA transactions in persistence.xml. For whatever reason, I have found that when using JTA, you MUST specify a JNDI data source within persistence.xml as well. This is fine, unless you are trying to go integration testing outside a container and JNDI is not available.
My questions are:
a) is there anyway to inject a jdbc datasource into my JTA transaction manager? b) if not, how do a handle a JNDI lookup during integration testing?
Edit: The error I get when firing up the integration test is:
Caused by: org.springframework.......DataSourceLookupFailureException:
Failed to look up JNDI DataSource with name 'java:comp/env/jdbc/myAppDataSource';
nested exception is javax.naming.NoInitialContextException: 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