if you use application client
you can run it with applclient application bundled with glassfish to run it ans using benefits of Java EE 5 Application client container.
if you have netbeans, you can create an Enterprise application then you have three sub projects:
1) EJB project
2) Web project
3) Application client module
the first 2 are checked by default and you have to check the 3'rd option.
then netbeans creates an enterprise application with a client module for your.
the client is compiled as a jar, and can be deployed to a glassfish server or runned using appclient application.