In either case, the deployment descriptor for each session bean (Task or Service) simply includes an EJB-REF for each session bean that it actually USES.
While JBoss has a rich set of XDoclet tags available for nearly every task you can think of related to deployment descriptor generation, Geronimo lags behind in this area.
Thee fchdir function provides us with an easy way to accomplish this task. When we want to return to where we started, we can simply pass the file descriptor to fchdir.