Здесь простой отл. (Я использую OC4J)
/* import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;*/
public static void main(String[] args) throws NamingException,
ClassNotFoundException,
NoSuchMethodException,
IllegalAccessException,
InvocationTargetException,
InstantiationException {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"oracle.j2ee.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "oc4jadmin");
env.put(Context.SECURITY_CREDENTIALS, "welcome");
env.put(Context.PROVIDER_URL, "ormi://127.0.0.1:23891");
InitialContext ctx = new InitialContext(env);
Object obj =
ctx.lookup("mypackagename.MyEJBInterfaceName");
Class clazz = obj.getClass();
System.out.println("Creating method...");
Method mthd = clazz.getMethod("methodsName", null); /* without parameters in this case (public void methodsName() {...}) */
System.out.println("the call...");
mthd.invoke(obj, null);
System.out.println("end...");
}