EJB is not easy, deploying is not simple, different platforms different containers, the head is full. WebLogic This east wise cow, worth studying, take it with it.
The writing process does not say, just say that deployment and calling, the following three codes have been well explained.
1, EJB-JAR.XML XML Version = "1.0" Encoding = "UTF-8"?> http://java.sun.com/dtd/ejb-jar_2_0.dtd ''>
session> enterprise-beans>
ejb-jar>
2, WebLogic-EJB-JAR.XML (WebLogic Agency Profile) http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd '>
stateless-session-descriptor>
3, HelloClient.java (client code, the best and four interfaces) / * * Created on 2004-5-11 * / package org.bromon.ejb.session; import javax.naming. *; Import javax. RMI. *; import java.util. *; / ** * @Author bromon * / public class helloclient {public static void main (string args []) {Try {Properties Prop = New Properties (); Prop.Put (context .INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory"); // loading weblogic context prop.put (Context.PROVIDER_URL, "t3: // localhost: 7001"); // weblogic specific protocol context ctx = new InitialContext (prop) Object obj = ctx.lookup ("Hello"); HelloHome Home = (HelloHome) PortableRemoteObject.Narrow (Obj, HelloHome.class); Hello Hello = Home.create (); system.out.println (Hello.Say () Hello.remove ();} catch (exception e) {system.out.println (e);}}}