CWNEN1001E: The object referenced by the java:comp/env/myPersistenceConnection JNDI name could not be instantiated

I have an application that was originally written in Liberty 8.5.5.2 and EJB 3.0 with Derby, I've migrated to 8.5.5.6 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 …