geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juergen Weber <webe...@gmail.com>
Subject Re: Accessing corba from geronimo
Date Wed, 22 Oct 2008 15:10:52 GMT

Using information from
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/tnam_develop_naming.html
I tried the code below, both ways to get the Orb work, probably the second
one is better in an EJB.

Juergen



	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException,
		IOException
	{
		NamingContextExt nc = null, ncn = null;
		ORB orb2 = null;
		
		try
		{
			org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
			org.omg.CORBA.Object obj = null;
			
			nc =
NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));
			
			
			Context initialContext = new InitialContext(); 
			orb2 = (ORB) initialContext.lookup("java:comp/ORB");

		}
		catch (Exception e)
		{
			throw new ServletException(e);
		}
		
		PrintWriter writer = resp.getWriter();
		writer.write("doGet done. nc = " + nc + " orb2=" + orb2);

---

output:
doGet done. nc =
org.omg.CosNaming._NamingContextExtStub:org.apache.yoko.orb.CORBA.Delegate@117420e
orb2=org.apache.yoko.orb.CORBA.ORB@1f1dc0f

-- 
View this message in context: http://www.nabble.com/Accessing-corba-from-geronimo-tp20095314s134p20112889.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message