[jboss-user] [EJB 3.0] - Re: Can I access ejb3.0 via corba?
ragavgomatam
do-not-reply at jboss.com
Sun Jan 6 22:20:33 EST 2008
I have the snippet attached for accessing ejb via Corba. I had done it with ejb 2.0 in a distributed environment. using the undermentioned snippet For jboss I think you will have to run the "all" configuration that supports iiop. So you might want to start server with run -c all. Also deploy to the "all" configuration & check it out.
import javax.naming.Context;
| import javax.naming.InitialContext;
| import org.omg.CORBA.ORB;
| import org.omg.CosNaming.NamingContextExt;
| import org.omg.CosNaming.NamingContextExtHelper;
| ...
|
| // Obtaining a reference to the server ORB
|
| Context initialContext = new InitialContext();
| ORB orb = (ORB) initialContext.lookup("java:comp/ORB");
|
| //Invoking resolve_initial_references
| // Obtain ORB reference as shown in examples earlier in this section
| ...
| org.omg.CORBA.Object obj = orb.resolve_initial_references("NameService");
| NamingContextExt initCtx = NamingContextExtHelper.narrow(obj);
|
| ...
| //Steps above illustrate getting Initial Context with CosNaming
| // Look up the home interface using the name under which the EJB home is //bound (assuming AccountEjb)
| org.omg.CORBA.Object ejbHome = orb.string_to_object(
| "corbaname:iiop:myHost:2809/NameServiceServerRoot#mycompany/accounting");
| accountHome =
| (AccountHome)javax.rmi.PortableRemoteObject.narrow(ejbHome, AccountHome.class);
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117429#4117429
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117429
More information about the jboss-user
mailing list