JNDI setup and configuration is one of those parts of java where the differences between container implementations are just enough to be a barrier to porting your application to a different server. This combined with the incompatibilities with JPA between implementations can lead to vendor or stack lock-in, hopefully this get better with the next release of JPA.
One of the issues with JPA is using JNDI datasources for your persistenceContext.
Glassfish JNDI setup and persistence.xml
Glassfish does not require any special handlng for its JNDI entry.