First of all, I would like to know why you are using EJB 2.1. There have been 2 versions of EJB released after this (3.0, 3.1). EJB 3.1 is much easier, so,
you should look to develop EJBs with 3.1
Secondly, normally EJBs are invoked from within web applications, typically
servlets. With JEE 6, that would be much easier to do with Annotations.
Invoking a EJB from a
Java client is possible, but will need some work to do. The client will need the EJB interfaces in the classpath.
Normally, you would do a JNDI lookup to the server to get the EJB which is done by creating a InitialContext object. The InitialContext class has an overloaded constructor which will take a Properties object.
You will need to populate this Properties object with the provider url (which will have the ip, portno and the protocol used). It will also need a context factory which will be app server specific.