The client program for WebLogic can be JSP / servlet, or it can be Application. 1) JSP / servlet and EJB run on the same application server, the typical code can be as follows: (There is no need to establish a connection under the T3 protocol, completely completed by the client) Context CTX = new initialContext (); object obj = ctx.lookup ("EJB / COM / J2EE / FIRST / EJB / HelloHome"); HelloHome TRH = (HelloHome) PortableRemoteObject.narrow (Obj, HelloHome.Class); Hello Tr = TRH.CREATE (); OUT.PRINTLN (Tr.Hello )); Note: This JNDI-NAME can be placed in web.xml and use string jndiname = getServletConfig (). GetInitParameter ("Para-name") to get JNDI.2) For a general Application, it is not the same as EJB Under an application server, it is afraid that it is on the same machine. Note: (1) System variables in the client must be: ../ WebLogic81 / Server / lib / weblogic.jar; otherwise you cannot run. (2) The file configuration must be: Remote class, remote HOME class (generally does not include a bean class, ie business class) to ensure customer class run. These files are usually organized in the form of a package, pay attention to whether the Package is correct, otherwise an error. The typical code can be as follows: string url = "t3: // localhost: 7001"; Properties Prop = New Properties (); Prop.Put (Context.Provider_URL, URL); Prop.Put (Context.Initial_Context_Factory, "WebLogic.jndi .WLInitialContextFactory "); prop.put (Context.SECURITY_PRINCIPAL," name "); prop.put (Context.SECURITY_CREDENTIALS," code "); Context ctx = new InitialContext (prop); Object obj = ctx.lookup (" ejb / COM / J2EE / FIRST / EJB / HELLOHOME "); HelloHome TRH = (HelloHome) PortableRemoteObject.Narrow (Obj, HelloHome.Class); Hello Tr = TRH.CREATE (); system.out.println (tr.hello ()) Note: context.security_principal and context.security_credentials are optional, involving permissions to EJB operations.