I've been working with Compass on a few projects based either on Grails and Spring (Grails features Spring under the covers). Recently, I needed to incorporate Compass into a project based on the Glassfish platform.
The actual implementation was a little trickier than expected, but the final result was worth the effort. I've blogged about my experience, providing both a synopsis of the problems encountered as well as fully coded classes to get you started.
I'm not 100% happy with the result, and in my gut I know there's a more elegant solution: I used a Singleton to be called from within a BMT configured session facade for initialization.
If you're in the same position, and need some assistance, this article will get you to a working system. On the other hand, if you've dealt with this issue before, and have some advice, I'd be very interested to hear from you.
View the article: Glassfish JPA and Compass