Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hosting a CORBA object with a Weblogic Container

14 views
Skip to first unread message

Michael McKnerney

unread,
Mar 12, 2004, 2:23:30 PM3/12/04
to
Hi,

I'm trying to host a CORBA object within a Weblogic (8.1) container
using the weblogic built-in ORB and only using CORBA-compliant APIs.

When I try to obtain the RootPOA using:

org.omg.CORBA.Object obj = orb.resolve_initial_references("RootPOA");

The container throws the exception:

Unexpected System Exception:org.omg.CORBA.ORBPackage.InvalidName

Usually this means that the POA was not registered as an initial
service, but that just can't be the case since I know the weblogic EJB
container uses the POA.

Btw- the handle to the orb was obtained using:

// Initialize the ORB.
String args[] = null;
Properties Prop;
Prop = new Properties();
Prop.put("org.omg.CORBA.ORBClass",
"weblogic.wtc.corba.ORB");
ORB orb = (ORB)new InitialContext().lookup("java:comp/ORB");

Any ideas are greatly appreciated.

Mike

Andy Piper

unread,
Mar 15, 2004, 2:17:19 PM3/15/04
to
Michael McKnerney <michael....@baesystems.com> writes:

> I'm trying to host a CORBA object within a Weblogic (8.1) container
> using the weblogic built-in ORB and only using CORBA-compliant APIs.
>
> When I try to obtain the RootPOA using:
>
> org.omg.CORBA.Object obj = orb.resolve_initial_references("RootPOA");
>
> The container throws the exception:
>
> Unexpected System Exception:org.omg.CORBA.ORBPackage.InvalidName

I'm sorry, we didn't have time to implement the POA in 8.1, I am
working on that now for 9.0. If you want to use the POA in 8.1 you
need to use the J2SE ORB.

andy
--

Michael McKnerney

unread,
Mar 16, 2004, 1:25:16 PM3/16/04
to
Thanks for the info Andy.

Btw-  I will use the J2SE ORB in the meantime. My understanding is that there can only be one ORB per weblogic server, or can the J2SE co-exist with the existing weblogic ORB?  (I looked at the docs but it was still not clear to me)

To use the J2SE ORB, I modified my weblogic startup script  so that it contains property settings for org.omg.CORBA.ORBSingletonClass and org.omg.CORBA.ORBClass, i.e.,

"%JAVA_HOME%\bin\java" %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% -Dweblogic.Name=%SERVER_NAME% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% -Djava.security.policy="%WL_HOME%\server\lib\weblogic.policy" -Dorg.omg.CORBA.ORBSingletonClass=com.
sun.corba.se.internal.corba.ORBSingleton -Dorg.omg.CORBA.ORBClass=com.sun.corba.se.internal.Interceptors.PIORB  weblogic.Server

But now anytime I invoke on an object reference, the call hangs.

Do you have any suggestions on what the problem might be?

Thanks for the help,
Mike

Andy Piper

unread,
Mar 16, 2004, 4:10:35 PM3/16/04
to
Michael McKnerney <michael....@baesystems.com> writes:

> Btw-  I will use the J2SE ORB in the meantime. My understanding is that there can only be
> one ORB per weblogic server, or can the J2SE co-exist with the existing weblogic ORB?  (I
> looked at the docs but it was still not clear to me)

They should be able to coexist if you pass the ORB class in as a
property to ORB.init() and are not using RMI-IIOP. The WLS
ORBSingletonClass should be compatible with the Sun one a vice versa.

> -Dorg.omg.CORBA.ORBClass=com.sun.corba.se.internal.Interceptors.PIORB 

Try putting this in ORB.init() instead.

> But now anytime I invoke on an object reference, the call hangs.

Not sure. can you get threaddumps.

andy

Michael McKnerney

unread,
Mar 18, 2004, 8:30:20 PM3/18/04
to
Thank Andy,

Still no luck, however, the call does not hang it thows and I wasn't catching the exception and printing the stack trace. 

Here's my sample code and the stack trace. Do you see what the problem is?

// Method: ejbFindBigAccounts {
  try {
          String args[] = null;
          Properties Prop = new Properties();
          Prop.put("org.omg.CORBA.ORBClass",  "com.sun.corba.se.internal.Interceptors.PIORB");
          System.out.println("Initializing the orb...");
          ORB orb =  org.omg.CORBA.ORB.init(args, Prop);
          // Test list_initial_services
          System.out.println("Calling resolve_initial_references");
          java.lang.String[] ids = orb.list_initial_services();
          for (int i=0; i<ids.length; ++i)
             System.out.println(ids[i]);

  } catch (Exception e) {
    System.out.println("Caught Exception: " + e);
    e.printStackTrace();
    throw new EJBException (e);
 }
}

Output (including stack trace)
====================
Initializing the orb...
Calling resolve_initial_references
Caught Exception: org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 201  completed: No
        at com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:148)
        at com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:65)
        at com.sun.corba.se.internal.iiop.GIOPImpl.getConnection(GIOPImpl.java:67)
        at com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:652)
        at com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:594)
        at com.sun.corba.se.internal.corba.InitialNamingClient.getInitialServices(InitialNamingClient.java:997)
        at com.sun.corba.se.internal.corba.InitialNamingClient.cachedServices(InitialNamingClient.java:967)
        at com.sun.corba.se.internal.corba.InitialNamingClient.list_initial_services(InitialNamingClient.java:925)
        at com.sun.corba.se.internal.corba.ORB.list_initial_services(ORB.java:2414)
        at examples.ejb20.basic.beanManaged.AccountBean.ejbFindBigAccounts(AccountBean.java:328)
        [snip]

Seeing that its trying to get a connection, does that mean I need to run the jdk orbd?  I figured the weblogic server would take the place of orbd.  Anyway, I ran the same test with orbd running and got the same exception and stack trace.


Thanks, Mike
-----------

Andy Piper

unread,
Mar 19, 2004, 1:32:34 PM3/19/04
to
Michael McKnerney <michael....@baesystems.com> writes:

Hmmn weird. It seems like it wants a URL or something to connect to which seems wrong.
The source for list_initial_services says:

/**
* Get a list of the initially available CORBA services.
* This does not work unless an ORBInitialHost is specified during initialization
* (or unless there is an ORB running on the AppletHost) since the localhostname
* is inaccessible to applets. If a service properties URL was specified,
* then it is used, otherwise the bootstrapping protocol is used.
* @return A list of the initial services available.
*/

So you need an initial host if you use this. However, the root poa is
already registered, so it looks like you can use that. You will need
an initial host if you want to bind things into the NS, in theory you
should be able to use WLS for that.

andy

> org.omg.CORBA.COMM_FAILURE:   vmCORBAObjectImpl.javacid: SUN  minor code: 201  completed: No

--

Michael McKnerney

unread,
Mar 29, 2004, 1:50:59 PM3/29/04
to
Thanks Andy!

Btw-  orbd must be running for resolve_initial_references() to work.  Seems weird to me.

After which,  I was able to host a callback servant in my weblogic container using the native JDK ORB/POA but now I've run into a deeper issue.  When the client calls back on the hosted callback object, the JDK ORB processes the request but then raises an IT_GIOP:REPLY_MESSAGE_NOT_CONSUMED exception.  

It's since been  brought to my attention that  this indicates a marshalling error with regards to extra bytes being on the stream after the request has been unmarshaled.   Either due to a spotty or older ORB implementation.    The advise is that the JDK ORB is just such an ORB.

I'd like to try using the JacORB within my weblogic container. 

Has anyone done this that you know of?


Thanks for the help,
Mike

Andy Piper

unread,
Mar 29, 2004, 2:36:44 PM3/29/04
to
Michael McKnerney <michael....@baesystems.com> writes:

> Btw-  orbd must be running for resolve_initial_references() to work.  Seems weird to me.
> After which,  I was able to host a callback servant in my weblogic container using the
> native JDK ORB/POA but now I've run into a deeper issue.  When the client calls back on
> the hosted callback object, the JDK ORB processes the request but then raises an
> IT_GIOP:REPLY_MESSAGE_NOT_CONSUMED exception.  
> It's since been  brought to my attention that  this indicates a marshalling error with
> regards to extra bytes being on the stream after the request has been unmarshaled.  
> Either due to a spotty or older ORB implementation.    The advise is that the JDK ORB is
> just such an ORB.

I'd be surprised if this was the case for the 1.4 ORB. I would surmise
that your client is at fault here rather than the server. Incidentally
many orbs allow you to turn off this correctness checking (including
Orbix). IT_GIOP looks like an Orbix message. Are you sure this is
coming from the JDK ORB?


> I'd like to try using the JacORB within my weblogic container. 
> Has anyone done this that you know of?

Yes. I believe a partner does this successfully, and indeed our CORBA
connector uses JacORB.

andy

Tofael Khan

unread,
Jul 23, 2004, 2:56:39 PM7/23/04
to
Michael:

Did you finally resolve this issue? I'm having the same problem, and hope to get a quick hint. Thanks!!

Lily

Andy Piper

unread,
Jul 26, 2004, 11:27:55 PM7/26/04
to
Tofael Khan <noad...@noaddress.given> writes:

Which problem, exactly, are you referring to? There were many in this thread.

andy

0 new messages