Re: EJB weblogic client and ORBACUS C++ server
Darren Middleman <[email protected]>
| Newsgroups | gmane.comp.corba.orbacus |
|---|---|
| Organization | IONA | Making Software Work Together TM |
| Message-ID | <[email protected]> |
Hi Anoop,
On Thu, Mar 17, 2005 at 09:02:57PM +0530, Anoop Ahamad wrote:
>
> Dear Darren,
>
> We are trying to call Orbacus corba c++ server using EJB client
> (in Weblogic 8.1).
>
> I had written one stateless session bean in which there is a method(sayHello)
> which the EJB client is calling
>
> My Orbacus nameservice and c++ server are running on 192.168.1.28:8001
>
> where as EJB client calling from 192.168.1.32
>
> Note: We are able to do this sample with normal java client
>
> public class CorbaEaiBean implements SessionBean {
>
>
> public void sayHello()
> {
> String[] argv={"ORBInitRef NameService= ",
> "corbaloc:iiop:192.168.1.28:8001/NameService"};
> System.out.println("Starting");
> java.util.Properties props = System.getProperties();
> props.put("org.omg.CORBA.ORBClass", "com.ooc.CORBA.ORB");
> props.put("org.omg.CORBA.ORBSingletonClass",
> "com.ooc.CORBA.ORBSingleton");
> System.setProperties(props);
> org.omg.CORBA.ORB orb;
> System.out.println("Initialization start");
> orb = org.omg.CORBA.ORB.init(argv, props);
> System.out.println("Initialization over");
> // find the naming service
> org.omg.CORBA.Object obj = null;
> org.omg.CosNaming.NamingContext ctx;
>
> try {
> System.out.println("Before initial reference");
> obj = orb.resolve_initial_references(
> "NameService");
> }
> catch(org.omg.CORBA.ORBPackage.InvalidName e) {
> e.printStackTrace();}
>
> ctx = org.omg.CosNaming.NamingContextHelper.narrow(obj);
>
> // find the object reference
> NameComponent nc = new NameComponent("Hello", "");
> NameComponent path[] = {nc};
> org.omg.CORBA.Object helloObj = null;
>
> try {
> helloObj = ctx.resolve(path);
> } catch(Exception e) {e.printStackTrace();}
>
> HelloApp.Hello helloRef = HelloHelper.narrow(helloObj);
> helloRef.helloWorld();
> }
>
>
> We are getting this error:
>
> Starting
> Initialization start
> Initialization over
> Before initial reference
> org.omg.CORBA.ORBPackage.InvalidName:
> IDL:omg.org/CORBA/ORB/InvalidName:1.0
> at com.ooc.OB.InitialServiceManager.resolveInitialReferences
> (Ljava.lang.String;)Lorg.omg.CORBA.Object;(Initial
> ServiceManager.java:192)
> at com.ooc.OBCORBA.ORB_impl.resolve_initial_references(
> Ljava.lang.String;)Lorg.omg.CORBA.Object;(ORB_impl.java
> :1170)
>
The error you are getting seems to indicate that it can not resolve the
service you are trying to connect to, in your case, the NameService.
Without having tried out your code (what I have is incomplete), the way you
have specified the argv string seems a bit strange. I assume that you are
trying to mimic the way command line options would be stored. In that
case, I think it would be better to specify the options as follows:
String[] argv={"-ORBInitRef",
"NameService=corbaloc:iiop:192.168.1.28:8001/NameService"};
Again, I haven't been able to try this out since the code you have provided
is incomplete, but I think this is more what you are looking for.
You can also specify the NameService options through properties, which you
are already using for two other properties. In this case, you would be
trying to set the "ooc.orb.service.NameService" property. See the manual
(Chapter 3) for more details on using these properties.
Regards,
Darren
--
Darren Middleman, Software Engineer
Team Orbacus - Your CORBA Source
Email: mailto:[email protected]
WWW: http://www.orbacus.com/
_______________________________________________
OB-Users Mailing List - [email protected]
http://mail.ooc.nf.ca/mailman/listinfo/ob-users
Visit our support FAQ before you send a message.
http://www.orbacus.com/faq/support.html