I have an application that was originally written in Liberty 184.108.40.206 and EJB 3.0 with Derby, I've migrated to 220.127.116.11 and EJB 3.1, still Derby, and (following some feature tweaking) it builds fine.
If the JNDI name is incorrect in the java code, I get a NameNotFoundException as expected.
But if I correct it, instead runtime fails with this:
getEntityManager naming error CWNEN1001E: The object referenced by the java:comp/env/myPersistenceConnection JNDI name could not be instantiated. If the reference name maps to a JNDI name in the deployment descriptor bindings for the application performing the JNDI lookup, make sure that the JNDI name mapping in the deployment descriptor binding is correct. If the JNDI name mapping is correct, make sure the target resource can be resolved with the specified name relative to the default initial context.
The underlying cause is that the JPA persistence manager has changed from Apache to EclipseLink: https://developer.ibm.com/wasdev/blog/2014/05/28/eclipselink-jpa-provider-liberty-profile/
And the problem was not in web.xml but in persistence.xml, I needed to remove this line: org.apache.openjpa.persistence.PersistenceProviderImpl
(No need to replace with a new provider, it's found automatically).
I found this trace string useful in diagnosing the problem: com.ibm.ws.jpa.*=all
Maven Integration in RAD 8.0.4 5 Answers
Configuration questions 0 Answers
Static variables across ear / war 3 Answers