As it has been said there is no problem to export a UnicastRemoteObject inside glassfish because it's just java. I could imagine you can start and stop your rmi server inside an application context listener so your rmi service will follow the life cycle of your application.
I don't know what you intend to do but I'm always sure you will not find any tutorial explaining that because that's not the normal way to go.
If you want to expose services that exchange java objects, it's better to implement it as EJB3 session (stateless or stateful). It as simple as plain rmi, it will leverage all the facilities glassfish has and it will be well integrated to your global application.
The only difference is that it will use IIOP (corba) protocol rather than JRMP (JSE rmi). But it's tranparent to you.
[Message sent by forum member 'florent_garin' (florent_garin)]
http://forums.java.net/jive/thread.jspa?messageID=249711