I have two applications running on my local glassfish server. One to rent bicylces and one to buy train tickets. I now wanted to call a remote ejb from the train application
You should have a FahrradService-EJB
jar, and an FahrradService-client
jar (names are examples, just have the two jars). Your IDE would have generated both for you if you created an EJB using Jave EE plugins/tooling.
Your EBJ jar and the client jar will both be packaged with one of the applications. Deployment of the application will establish the EJB, so it can be referenced, looked up, injected, etc.
Your client jar will be packaged in any other application that wants to use the EJB via @EJB or lookup.
Assuming both applications are to be deployed to the same app-server instance, it should be just about that simple.