One problem I have lately is with the use of Spring-managed transaction on GlassFish. The official tutorial article is helpful to a certain point, but does not answer the problem with the use of @PersistenceContenxt annotation on GlassFish.
The problem is that I have transaction-type="RESOURCE_LOCAL" in persistence.xml for maximum portability. I prefer not to deal with JNDI and container-provided data sources. In this case, however, GlassFish complains that @PersistenceContenxt can only be used with transaction-type="JTA", and refuses to deploy my app.
Well, thanks to the solution described here, the cure is actually very simple. Just add metadata-complete="true" to the <web-app> element in web.xml.