RE: [corba] ORB initializing in Servlet

2002-11-27 Thread Eoin Woods
Here's a working example of a servlet initialising the ORB as it loads:
 
   public void init(ServletConfig cfg) throws ServletException {

try {
   String[] orbArgs = {-ORBInitialHost,
   localhost,
   -ORBInitialPort,
   1050} ;
   ORB orb = ORB.init(orbArgs, null);
   org.omg.CORBA.Object objRef = 
   orb.resolve_initial_references(NameService);  
   NamingContextExt ncRef  = 
   NamingContextExtHelper.narrow(objRef);
   org.omg.CORBA.Object  obj  = ncRef.resolve_str(MyService) ;
   svcRef = SimpleServiceHelper.narrow(obj);
} catch(Exception e) {
System.out.println(Failed to initialise ORB:  + e) ;
e.printStackTrace() ;
throw new ServletException(ORB initialisation failure, e)
;
}
}
 
Eoin.

-Original Message-
From: Halil AKINCI [mailto:[EMAIL PROTECTED]] 
Sent: 27 November 2002 07:18
To: Tomcat Users List; servlet-interest group; jakarta-tomcat yahoo
groups; idl-user; CORBA_Official; [EMAIL PROTECTED]; CORBA
Subject: [corba] ORB initializing in Servlet


Hi,
 
I want to use a servlet as a CORBA client. I developed a sample
application, but it is returned an error message. I think, I could not
initialize the ORB correctly within the servlet class. I need a sample
to initialize ORB and resolve the object reference in naming within the
servlet class. Can anyone help me?
 
Note: I use Java 2 SDK v1.4.0 and JavaIDL
 
Halil

Yahoo! Groups Sponsor   

ADVERTISEMENT
 
http://rd.yahoo.com/M=237459.2675695.4055211.2225243/D=egroupweb/S=1707
276718:HM/A=1267611/R=0/*http://ad.doubleclick.net/jump/N2524.Yahoo/B107
1650;sz=300x250;ord=1038382220206228?  
 
http://us.adserver.yahoo.com/l?M=237459.2675695.4055211.2225243/D=egrou
pmail/S=:HM/A=1267611/rand=935653631   

To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
http://docs.yahoo.com/info/terms/ . 





ORB initializing in Servlet

2002-11-26 Thread Halil AKINCI
Hi,

I want to use a servlet as a CORBA client. I developed a sample application, but it is 
returned an error message. I think, I could not initialize the ORB correctly within 
the servlet class. I need a sample to initialize ORB and resolve the object reference 
in naming within the servlet class. Can anyone help me?

Note: I use Java 2 SDK v1.4.0 and JavaIDL

Halil