geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: org.omg.CosNaming.NamingCntextPackage.NotFound
Date Wed, 21 Sep 2005 20:19:55 GMT

On Sep 21, 2005, at 3:52 PM, lin sun wrote:

> Thanks for your note!  Still trying to digest it.  Do
> you mean after I create a J2EE app client and deploy
> it to geronimo, I can build some non-j2ee app client
> to communicate to the J2ee app client via IIOP?
Not exactly.  AFAIK no one has used an ejb in geronimo from a non-j2ee  
client through CORBA.  We have, in the tck work, used ejbs in geronimo  
(and the sun ri) from a j2ee app client using CORBA.  I thought it  
would be simpler to start with something that is known to work with  
correct configuration, then work on the non-j2ee client which might  
have additional problems.

>   Can I
> use J2SE as the non-J2EE app client?  Also, is it
> possible to run the client-server communication
> without the security enabled for test purpose before
> you publish the security setup document?

I'm not sure whether it is possible to run with no security configured.  
  We have a "unsecured" configuration but it has always been run with  
the security gbeans present so I'm not sure if they are required.
> I am trying to understand why starting with a j2ee
> app-client would be easier than my approach since I
> already got a good portion working.   Here's my
> approach...Could you please tell me if this is viable?
> 1) Deploy the simple EJB I have to geronimo...
> Hopefully geronimo would generate the stub on the fly
> for me.

Well, we don't really need any server side code generation but the  
client side would be done with a cglib proxy.
> 2) Create the J2SE client to communicate to the EJB
> via RMI over IIOP
> - I want it to communicate to the name server on port
> 1050 (create the initialContext and perform the
> lookup)
> - I want to use PortableRemoteObject.narrow function
> for IIOP communication to perform the cast.

This is all good, but IIUC not sufficient.
> Normally, I would just use the stubs from the server
> for the client, but I am lost as to what to do with
> geronimo.  I would have the same question if I decided
> to go with the j2ee app client easier path you
> recommended below.

I believe you need an orb running on the client.  In the geronimo app  
client, this comes from these two gbeans:

     <gbean name="DyanmicStubClassLoader"  

     <gbean name="Server" class="org.openejb.corba.CORBABean">
         <reference name="ThreadPool">
         <reference name="SecurityService">
         <attribute name="args">-ORBPort, 9683, -ORBInitRef,  
         <attribute name="props">

The first one sets up the cglib stuff for dynamic stubs, the second is  
the orb itself.  In addition you need some CSSBean set up so the csiv2  
negotiations can proceed, even if they say "no security" at each end.   
An example would be:

    <gbean name="NoSecurity" class="org.openejb.corba.CSSBean">
         <reference name="ThreadPool">
         <reference name="TransactionContextManager">
         <attribute name="description">NoSecurity</attribute>
         <attribute name="cssArgs"></attribute>
         <xml-attribute name="cssConfig">
                             <css:supports>Integrity Confidentiality  
EstablishTrustInTarget EstablishTrustInClient</css:supports>

I suspect that if you remove the security service reference from the  
corbabean you will be able to get corba to work on an app client with  
no security.  You will need to deploy your ejbs with a tss-link to the  
corresponding no-security server side tss bean.

Now, the gbean framework is not doing all that much for you here, and  
it would not be very much code to create the orb, create and register  
the classloader, and set up the css bean.  Basically you just need to  
call the gbean constructors and their doStart methods.  It is probably  
easier to just create the orb in your  own code rather than starting  
the CORBABean itself, since you may not want to have a thread pool for  
the sole purpose of starting an orb :-)  I'm not sure what you will  
need to add to your classpath: certainly openejb-core and  
geronimo-spec-corba-2.3-rc4.jar, but I don't know what else.

Hope this helps and please ask if you run into more problems.

david jencks

> --- David Jencks <> wrote:
>> IIUC 1050 is correct.
>> There's quite a bit to set up to get this to work.
>> IMO it is
>> considerably easier to start with a j2ee app-client
>> and configure the
>> stuff using a gbean plan.  Unfortunately this will
>> currently only run
>> on a machine with all of geronimo installed.  Also
>> we haven't published
>> examples of all the plans you need.  A starting
>> point is the
>> j2ee-client-corba-plan.xml.  What is missing from
>> this plan is a client
>> side security setup.  I've been  hoping to get to
>> writing a publishable
>> version of this for the last week but have been too
>> busy.
>> Once you get stuff running as an app client I think
>> you will be able to
>> start all the components you need in code pretty
>> easily for a
>> non-j2ee-app-client client.  There may be easier
>> ways to do this but I
>> don't know what they are.
>> We are using dynamic cglib proxy generation for the
>> stubs.
>> Theoretically you should also be able to use
>> compiled stubs but I have
>> no experience with how to do this.
>> Sorry for the delay in responding, I hope to get
>> more info available
>> soon....
>> david jencks
>> On Sep 20, 2005, at 11:29 AM, lin sun wrote:
>>> I forgot to mention that I am using a build
>> checked
>>> out from HEAD last week.
>>> Actually I was able to get further using 1050.
>> If I
>>> use iiop://localhost:1099, I would get an
>> exception
>>> when instantiate the new InitialContext ctx:
>>> javax.naming.CommunicationException: Cannot
>> connect to
>>> ORB [Root exception is org.omg.CORBA.COMM_FAILURE:
>>> vmcid: SUN  minor code: 208 completed: Maybe]
>>> My understanding is that if I use IIOP, I would
>> need
>>> to   talk to the name server which is listening on
>>> 1050 by default after the j2ee-server-corba.xml
>> plan
>>> is deployed.
>>> I suspect that I would need to generate stubs for
>> the
>>> EJB I deployed to help the ctx.lookup().   Anyone
>>> knows how to do that with geronimo?  I saw some
>>> examples using the -iiop option from weblogic.
>>> --- Ken Perl <> wrote:
>>>> I guess the client is providing the wrong URL,
>> try
>>>> to use 1099 instead
>>>> of iiop://localhost:1050.
>>>> On 9/20/05, lin sun <> wrote:
>>>>> Hello there,
>>>>> I am having problems in communicating to a
>> simple
>>>> EJB
>>>>> from a Java RMI client via IIOP.   I was able to
>>>>> deploy the EJB jar to geronimo, but I kept
>> getting
>>>> the
>>>>> following exception when I ran the Client:
>>>>> javax.naming.NameNotFoundException [Root
>> exception
>>>> is
>>>>> org.omg.CosNaming.NamingContextPackage.NotFound:
>>>>> The client app failed at ctx.lookup(JNDI_NAME)
>> and
>>>>> I've made sure that I specified the same
>>>> in
>>>>> the client app as I specified in the
>>>> openejb-jar.xml
>>>>> "<jndi-name>" property.
>>>>>       Object home = ctx.lookup(JNDI_NAME);
>>>> //failed
>>>>> here
>>>>> The client app is able to instantiate the new
>>>>> InitialContext ctx:
> p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFact
>>> ory");
>>>>>       p.put(Context.PROVIDER_URL,
>>>>> "iiop://localhost:1050");
>>>>>       InitialContext ctx = new
>> InitialContext(p);
>>>>> I could not find much info related to RMI over
>>>> IIOP
>>>>> from the wiki... help is appreciated!
>>>>> thanks,
>>>>> Lin
>>>>> __________________________________
>>>>> Yahoo! Mail - PC Magazine Editors' Choice 2005
>>>> -- 
>>>> perl -e 'print
>>>> unpack(u,"62V5N\"FME;G\!E<FQ`9VUA:6PN8V]M\"\@``
>>>> ")'
>>> thanks,
>>> Lin
>>> __________________________________
>>> Yahoo! Mail - PC Magazine Editors' Choice 2005
> thanks,
> Lin
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005

View raw message