这是我必须创建 EJB 2.0 的代码我如何转换它以便可用于 EJB 3.0
java.lang.Object ejbHomeStub = initCtx.lookup(ejbJNDIName);
EJBHome ejbHome = (EJBHome)
javax.rmi.PortableRemoteObject.narrow(ejbHomeStub, EJBHome.class);
EJBMetaData ejbMetaData = ejbHome.getEJBMetaData();
Class ejbHomeClass = ejbMetaData.getHomeInterfaceClass();
//get ejb object of home interface type
ejbHome = (EJBHome) javax.rmi.PortableRemoteObject.narrow(ejbHome, ejbHomeClass);
//create ejb remote object
Method ejbMethodCreate = ejbHomeClass.getDeclaredMethod(EJB_CREATE, null);
ejbRemoteObj = (EJBObject) ejbMethodCreate.invoke(ejbHome, null);