RE: [corba] ORB initializing in Servlet

"Eoin Woods" <[email protected]> Wed, 27 Nov 2002 12:16:15 -0000
Newsgroups gmane.comp.jakarta.tomcat.user,gmane.comp.java.sun.servlet,gmane.comp.java.sun.idl.user
Organization At Home
Message-ID <002501c2960e$cb4d3b20$0000fea9@Dali>
------=_NextPart_000_0026_01C2960E.CB4EC1C0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

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/> . 



------=_NextPart_000_0026_01C2960E.CB4EC1C0--