Fixing “Could not resolve a persistence unit…” errors when PU is specified, found
问题 I'm running Glassfish 3.1-SNAPSHOT as of today (2010-11-12). I'm using the embedded EJBContainer. On the classpath, as reported by the EJBContainer, I have a META-INF/persistence.xml. This file defines two persistence units: one called "ngp" and one called "cx". Debugging output shows that the Glassfish JPA deployer finds it, and recognizes both the cx PU and the ngp PU. The EJBContainer bombs out with the following all-too-common JPA error: java.lang.RuntimeException: Could not resolve a