I try to setup a database connection in java with JNDI in combination with eclipseLink/JPA on Tomcat 5.5. I already configured the JNDI resource in web.xml and context.xml.
Just add the class JPAEclipseLinkSessionCustomizer to your project and configure the persistence.xml as shown below:
org.eclipse.persistence.jpa.PersistenceProvider java:comp/env/jdbc/yourDs
You need this workaround only for Apache Tomcat.