You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by lin sun <li...@yahoo.com> on 2005/09/19 22:22:15 UTC

org.omg.CosNaming.NamingCntextPackage.NotFound

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:
IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]

The client app failed at ctx.lookup(JNDI_NAME) and
I've made sure that I specified the same JNDI_NAME 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.CNCtxFactory");
      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 
http://mail.yahoo.com

Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by David Blevins <da...@visi.com>.
On Sep 21, 2005, at 1:19 PM, David Jencks wrote:

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

Last I knew, you needed these jars:
openejb-core-2.0-SNAPSHOT.jar
cglib-full-2.0.2.jar
geronimo-kernel-1.0-SNAPSHOT.jar
geronimo-security-1.0-SNAPSHOT.jar
geronimo-spec-j2ee-jacc-1.0-rc4.jar

That was before CORBA was added.  And this is for a generic client of  
an EJB not running in a J2EE App Client.

-David


Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
On 9/22/05, lin sun <li...@yahoo.com> wrote:
> I read Aaron's book on J2EE client application, and I didn't see anywhere mentions
> openejb-jar.xml, so I assume you mean geronimo-client.xml here?

The client chapter is still a work in progress.  I'm following this
thread to figure out what CORBA/IIOP client material I need to
present.  :)

Aaron

Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by lin sun <li...@yahoo.com>.
I also added a few debug statement on the client to print out the objref & its
superclasses:

22:25:02,254 INFO  [CommandLine] Server startup completed
User nameNameCallback returning system.
PasswordPasswordCallback returning [C@12dd538.
in MagicGBallClient.ask(Hi):
java.lang.Throwable
	at org.acme.MagicGBallClient.ask(MagicGBallClient.java:44)
	at org.acme.MagicGBallClient.main(MagicGBallClient.java:38)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.geronimo.client.AppClientContainer$1.run(AppClientContainer.java:179)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:320)
	at org.apache.geronimo.client.AppClientContainer.main(AppClientContainer.java:176)
	at
org.apache.geronimo.client.AppClientContainer$$FastClassByCGLIB$$b5beae18.invoke(<generated>)
	at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
	at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
	at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
	at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:795)
	at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:180)
	at org.apache.geronimo.system.main.CommandLine.invokeMainGBean(CommandLine.java:84)
	at org.apache.geronimo.system.main.ClientCommandLine.<init>(ClientCommandLine.java:50)
	at org.apache.geronimo.system.main.ClientCommandLine.main(ClientCommandLine.java:37)
objref is of type com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1
objref =
com.sun.corba.se.internal.iiop.CDRInputStream_1_0$1:IOR:000000000000002d524d493a6f72672e61636d652e4d616769634742616c6c486f6d653a3030303030303030303030303030303000000000000000010000000000000234000102000000000c392e34392e3232312e313700000000000000015fafabcb00000000209a19f6be0000000100000000000000020000001253534c436c69656e7450617373776f7264000000000000936765726f6e696d6f2e7365727665723a454a424d6f64756c653d6d616769634762616c6c2d656a622e6a61722c4a3245454170706c69636174696f6e3d6f72672f61636d652f4d616769634762616c6c2c4a3245455365727665723d6765726f6e696d6f2c6a326565547970653d53746174656c65737353657373696f6e4265616e2c6e616d653d4d616769634742616c6c0000000000926765726f6e696d6f2e7365727665723a454a424d6f64756c653d6d616769634762616c6c2d656a622e6a61722c4a3245454170706c69636174696f6e3d6f72672f61636d652f4d616769634762616c6c2c4a3245455365727665723d6765726f6e696d6f2c6a326565547970653d53746174656c65737353657373696f6e4265616e2c6e616d653d4d616769634742616c6c0a0000000004000000010000002000000000000100
 01000000
0205010001000100200001010900000001000101000000002000000004000000010000001f0000000400000003000000210000006c000000000000000100460000000000240000001a00000026000600000000000100000008302e302e302e300007d1004000400000000000080606678102010101000000170401000806066781020101010000000764656661756c740000000000000000000000000000000000
objref =        -RMI:org.acme.MagicGBallHome:0000000000000000               4       
<ipAddressHere>        _                            SSLClientPassword      
geronimo.server:EJBModule=magicGball-ejb.jar,J2EEApplication=org/acme/MagicGball,J2EEServer=geronimo,j2eeType=StatelessSessionBean,name=MagicGBall
    
geronimo.server:EJBModule=magicGball-ejb.jar,J2EEApplication=org/acme/MagicGball,J2EEServer=geronimo,j2eeType=StatelessSessionBean,name=MagicGBall
                                                                        !   l         F  
  $       &            0.0.0.0    @ @        g               g         default           
     
Superclasses:

org.omg.CORBA_2_3.portable.ObjectImpl
org.omg.CORBA.portable.ObjectImpl
java.lang.Object
Interfaces:

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.apache.geronimo.client.AppClientContainer$1.run(AppClientContainer.java:183)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:320)
	at org.apache.geronimo.client.AppClientContainer.main(AppClientContainer.java:176)
	at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
	at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
	at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:795)
	at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:180)
	at org.apache.geronimo.system.main.CommandLine.invokeMainGBean(CommandLine.java:84)
	at org.apache.geronimo.system.main.ClientCommandLine.<init>(ClientCommandLine.java:50)
	at org.apache.geronimo.system.main.ClientCommandLine.main(ClientCommandLine.java:37)
Caused by: java.lang.reflect.InvocationTargetException
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.geronimo.client.AppClientContainer$1.run(AppClientContainer.java:179)
	... 10 more
Caused by: java.lang.ClassCastException
	at
com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
	at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
	at org.acme.MagicGBallClient.ask(MagicGBallClient.java:56)
	at org.acme.MagicGBallClient.main(MagicGBallClient.java:38)
	... 12 more

--- lin sun <li...@yahoo.com> wrote:

> While I was waiting for help, I added some debug tracing into the client.log.   Here's
> what I got in my client.log:
> 
> 21:40:50,873 DEBUG [CORBAProxyReference] Obtaining home from
> corbaloc::localhost:1050/NameService, MagicGBall,
>
geronimo.client:J2EEApplication=null,J2EEModule=org/apache/geronimo/ClientCorba,J2EEServer=client,j2eeType=CORBACSS,name=SSLClientPassword,
> org.acme.MagicGBallHome
> 21:40:50,873 DEBUG [CSSBean] SSLClientPassword - Looking up home from
> corbaloc::localhost:1050/NameService at MagicGBall
> 21:40:50,893 DEBUG [OpenEJBSocketFactory] Created plain endpoint to localhost:1050
> 21:40:50,893 DEBUG [OpenEJBSocketFactory] Created plain socket to localhost:1050
> 21:40:50,903 DEBUG [OpenEJBSocketFactory] Created plain server socket on port 0
> 21:40:51,003 DEBUG [ClientSecurityInterceptor] Checking if target _is_a has a security
> policy
> 21:40:51,003 DEBUG [ClientTransactionInterceptor] Checking if target _is_a has a
> transaction policy
> 21:40:51,003 DEBUG [ClientTransactionInterceptor] linsun:  checking target has a
> transaction policy
> 21:40:51,003 DEBUG [ClientTransactionInterceptor] linsun:  ri:
> com.sun.corba.se.internal.Interceptors.ClientRequestInfoImpl@e80740 TAG_OTS_POLICY: 31
> 21:40:51,003 DEBUG [ClientTransactionInterceptor] linsun: org.omg.CORBA.BAD_PARAM:
> Could
> not find component with provided id.  vmcid: OMG  minor code: 28  completed: No
> 
> By looking at the javadoc of ClientRequestInfoOperations
>
(http://download.java.net/jdk6/docs/api/org/omg/PortableInterceptor/ClientRequestInfoOperations.html)
> 
> BAD_PARAM - thrown, with a standard minor code of 28, if no component exists for the
> given component ID.
> 
> Any help is appreciated!
> 
> Thanks, Lin
> 
> --- lin sun <li...@yahoo.com> wrote:
> 
> > 
> > --- lin sun <li...@yahoo.com> wrote:
> > 
> > > --- David Jencks <da...@yahoo.com> wrote:
> > > > Having 2 geronimo servers communicating by corba is definitely possible 
> > > > and you will be able to configure all the necessary parts using gbeans. 
> > > >   This would be the easiest to set up in my opinion.   In particular you 
> > > > should be able to do this now with the existing configurations and 
> > > > plans, without waiting for me to fix the ClientCORBA plan.   I was 
> > > > suggesting that you have ejbs deployed on a geronimo server and have 
> > > > the client be a j2ee application client, running in the geronimo 
> > > > application client container.  The geronimo app client container is a 
> > > > stripped down version of geronimo that includes the kernel, the gbean 
> > > > machinery, the transaction manager, and a few other pieces, but not 
> > > > ejbs or web apps.  Since it includes the kernel it is fairly easy to 
> > > > run components in it as gbeans.  This is what I was suggesting.
> > > 
> > > > To use an ejb from a j2ee application (such as a j2ee app client, web 
> > > > app, or ejb) you need to include in the geronimo/openejb plan ejb-ref 
> > > > information like this:
> > > > 1. where the naming server is and the name
> > > > 2. a css-link to supply the security info for csiv2 negotiation with 
> > > > the server.  A typical element might look like this:
> > > > 
> > > >             <ejb-ref>
> > > >                  <ref-name>ejb/Control</ref-name>
> > > >                  <ns-corbaloc>corbaloc::<target name service host>:<name 
> > > > service port>/NameService</ns-corbaloc>
> > > >                  <name>targetEjbName</name>
> > > >                  <css-link>SSLClientCert</css-link>
> > > >              </ejb-ref>
> > > > (fill in the correct values for the host and port)
> > > 
> > > I tried to have the J2EE client and EJB on different machines, but it didn't work. 
> 
> > On
> > > the client machine, I tried to deploy magicGball-client.jar with the following
> > geronimo
> > > application deployment plan:
> > > 
> > > <application-client
> > >             xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-client"
> > >             configId="client"
> > >             clientConfigId="org/acme/MagicGBall/Client"
> > >             clientParentId="org/apache/geronimo/ClientCorba">
> > >             <ejb-ref>
> > >                 <ref-name>mGBall</ref-name>
> > 
> > This turned out to be a typo.  This should be:  <ref-name>mGball</ref-name> 
> > 
> > Also add the "<jndi-name>" tag under the openejb portion of the geronimo application
> > plan
> > xml file as below:
> > 
> > <module>
> >          <ejb>magicGball-ejb.jar</ejb>
> >          <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar"
> configId="ejb"
> >              parentId="org/apache/geronimo/Server">
> >          <import>
> >               <uri>org/apache/geronimo/ServerCORBA</uri>
> >          </import>
> >              <enterprise-beans>
> >                  <session>
> >                      <ejb-name>MagicGBall</ejb-name>
> >                      <jndi-name>MagicGBall</jndi-name>
> >                      <tss-link>SSLClientPassword</tss-link>
> >                  </session>
> >              </enterprise-beans>
> >          </openejb-jar>
> >      </module>
> > 
> > Now I am getting the following exception when I ran the client:
> > 
> > 16:00:16,169 INFO  [LocalAttributeManager] Started LocalAttributeManager with data on
> > 10
> > configurations
> > 16:00:16,239 INFO  [LocalConfigStore:config-store] Loaded Configuration
> > geronimo.config:name="org/acme/MagicGBall/Client"
> > 16:00:16,249 INFO  [LocalConfigStore:config-store] Loaded Configuration
> > geronimo.config:name="org/apache/geronimo/ClientCorba"
> > 16:00:16,249 INFO  [LocalConfigStore:config-store] Loaded Configuration
> > geronimo.config:name="org/apache/geronimo/ClientSecurity"
> > 16:00:16,269 INFO  [LocalConfigStore:config-store] Loaded Configuration
> > geronimo.config:name="org/apache/geronimo/Client"
> > 16:00:16,439 INFO  [Configuration] Started configuration org/apache/geronimo/Client
> > 16:00:16,620 INFO  [Configuration] Started configuration
> > org/apache/geronimo/ClientSecurity
> > 16:00:16,760 INFO  [GeronimoLoginConfiguration] Added Application Configuration Entry
> > JMX
> > 16:00:16,760 INFO  [GeronimoLoginConfiguration] Added Application Configuration Entry
> > geronimo-properties-realm
> > 16:00:16,770 INFO  [GeronimoLoginConfiguration] Installed Geronimo login
> configuration
> > 16:00:16,840 INFO  [Configuration] Started configuration
> > org/apache/geronimo/ClientCorba
> > 16:00:17,451 INFO  [CSSBean] Started CORBA Client Security Server - SSLClientCert
> > 16:00:17,471 INFO  [CSSBean] Started CORBA Client Security Server - NoSecurity
> > 16:00:17,481 INFO  [CSSBean] Started CORBA Client Security Server - SSLClientPassword
> > 16:00:17,541 INFO  [Configuration] Started configuration org/acme/MagicGBall/Client
> > 16:00:17,561 INFO  [CommandLine] Server startup completed
> > User nameNameCallback returning system.
> > PasswordPasswordCallback returning [C@f42160.
> > java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
> >  at org.apache.geronimo.client.AppClientContainer$1.run(AppClientContainer.java:146)
> >  at java.security.AccessController.doPrivileged(Native Method)
> >  at javax.security.auth.Subject.doAs(Subject.java:320)
> >  at org.apache.geronimo.client.AppClientContainer.main(AppClientContainer.java:139)
> >  at
> > org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
> >  at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
> >  at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:795)
> >  at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:180)
> >  at org.apache.geronimo.system.main.CommandLine.invokeMainGBean(CommandLine.java:88)
> >  at
> org.apache.geronimo.system.main.ClientCommandLine.<init>(ClientCommandLine.java:50)
> >  at org.apache.geronimo.system.main.ClientCommandLine.main(ClientCommandLine.java:37)
> > Caused by: java.lang.reflect.InvocationTargetException
> >  at java.lang.reflect.Method.invoke(Method.java:324)
> >  at org.apache.geronimo.client.AppClientContainer$1.run(AppClientContainer.java:142)
> >  ... 10 more
> > Caused by: java.lang.ClassCastException
> >  at
> >
>
com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
> >  at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
> >  at org.acme.MagicGBallClient.ask(MagicGBallClient.java:47)
> >  at org.acme.MagicGBallClient.main(MagicGBallClient.java:38)
> >  ... 12 more
> > 
> > And the exception is from the following cast of MagicGBallClient.java:
> > 
> > Context myEnv = (Context) ctx.lookup("java:comp/env");
> > Object objref = myEnv.lookup("mGball");
> > MagicGBallHome ejbHome = (MagicGBallHome) PortableRemoteObject.narrow(objref,
> > MagicGBallHome.class);
> > 
> > Any help is appreciated!
> > 
> > Thanks, Lin
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around 
> > http://mail.yahoo.com 
> > 
> 
> 
> 
> 		
> __________________________________ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com
> 


thanks, 

Lin


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by lin sun <li...@yahoo.com>.
While I was waiting for help, I added some debug tracing into the client.log.   Here's
what I got in my client.log:

21:40:50,873 DEBUG [CORBAProxyReference] Obtaining home from
corbaloc::localhost:1050/NameService, MagicGBall,
geronimo.client:J2EEApplication=null,J2EEModule=org/apache/geronimo/ClientCorba,J2EEServer=client,j2eeType=CORBACSS,name=SSLClientPassword,
org.acme.MagicGBallHome
21:40:50,873 DEBUG [CSSBean] SSLClientPassword - Looking up home from
corbaloc::localhost:1050/NameService at MagicGBall
21:40:50,893 DEBUG [OpenEJBSocketFactory] Created plain endpoint to localhost:1050
21:40:50,893 DEBUG [OpenEJBSocketFactory] Created plain socket to localhost:1050
21:40:50,903 DEBUG [OpenEJBSocketFactory] Created plain server socket on port 0
21:40:51,003 DEBUG [ClientSecurityInterceptor] Checking if target _is_a has a security
policy
21:40:51,003 DEBUG [ClientTransactionInterceptor] Checking if target _is_a has a
transaction policy
21:40:51,003 DEBUG [ClientTransactionInterceptor] linsun:  checking target has a
transaction policy
21:40:51,003 DEBUG [ClientTransactionInterceptor] linsun:  ri:
com.sun.corba.se.internal.Interceptors.ClientRequestInfoImpl@e80740 TAG_OTS_POLICY: 31
21:40:51,003 DEBUG [ClientTransactionInterceptor] linsun: org.omg.CORBA.BAD_PARAM: Could
not find component with provided id.  vmcid: OMG  minor code: 28  completed: No

By looking at the javadoc of ClientRequestInfoOperations
(http://download.java.net/jdk6/docs/api/org/omg/PortableInterceptor/ClientRequestInfoOperations.html)

BAD_PARAM - thrown, with a standard minor code of 28, if no component exists for the
given component ID.

Any help is appreciated!

Thanks, Lin

--- lin sun <li...@yahoo.com> wrote:

> 
> --- lin sun <li...@yahoo.com> wrote:
> 
> > --- David Jencks <da...@yahoo.com> wrote:
> > > Having 2 geronimo servers communicating by corba is definitely possible 
> > > and you will be able to configure all the necessary parts using gbeans. 
> > >   This would be the easiest to set up in my opinion.   In particular you 
> > > should be able to do this now with the existing configurations and 
> > > plans, without waiting for me to fix the ClientCORBA plan.   I was 
> > > suggesting that you have ejbs deployed on a geronimo server and have 
> > > the client be a j2ee application client, running in the geronimo 
> > > application client container.  The geronimo app client container is a 
> > > stripped down version of geronimo that includes the kernel, the gbean 
> > > machinery, the transaction manager, and a few other pieces, but not 
> > > ejbs or web apps.  Since it includes the kernel it is fairly easy to 
> > > run components in it as gbeans.  This is what I was suggesting.
> > 
> > > To use an ejb from a j2ee application (such as a j2ee app client, web 
> > > app, or ejb) you need to include in the geronimo/openejb plan ejb-ref 
> > > information like this:
> > > 1. where the naming server is and the name
> > > 2. a css-link to supply the security info for csiv2 negotiation with 
> > > the server.  A typical element might look like this:
> > > 
> > >             <ejb-ref>
> > >                  <ref-name>ejb/Control</ref-name>
> > >                  <ns-corbaloc>corbaloc::<target name service host>:<name 
> > > service port>/NameService</ns-corbaloc>
> > >                  <name>targetEjbName</name>
> > >                  <css-link>SSLClientCert</css-link>
> > >              </ejb-ref>
> > > (fill in the correct values for the host and port)
> > 
> > I tried to have the J2EE client and EJB on different machines, but it didn't work.  
> On
> > the client machine, I tried to deploy magicGball-client.jar with the following
> geronimo
> > application deployment plan:
> > 
> > <application-client
> >             xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-client"
> >             configId="client"
> >             clientConfigId="org/acme/MagicGBall/Client"
> >             clientParentId="org/apache/geronimo/ClientCorba">
> >             <ejb-ref>
> >                 <ref-name>mGBall</ref-name>
> 
> This turned out to be a typo.  This should be:  <ref-name>mGball</ref-name> 
> 
> Also add the "<jndi-name>" tag under the openejb portion of the geronimo application
> plan
> xml file as below:
> 
> <module>
>          <ejb>magicGball-ejb.jar</ejb>
>          <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar" configId="ejb"
>              parentId="org/apache/geronimo/Server">
>          <import>
>               <uri>org/apache/geronimo/ServerCORBA</uri>
>          </import>
>              <enterprise-beans>
>                  <session>
>                      <ejb-name>MagicGBall</ejb-name>
>                      <jndi-name>MagicGBall</jndi-name>
>                      <tss-link>SSLClientPassword</tss-link>
>                  </session>
>              </enterprise-beans>
>          </openejb-jar>
>      </module>
> 
> Now I am getting the following exception when I ran the client:
> 
> 16:00:16,169 INFO  [LocalAttributeManager] Started LocalAttributeManager with data on
> 10
> configurations
> 16:00:16,239 INFO  [LocalConfigStore:config-store] Loaded Configuration
> geronimo.config:name="org/acme/MagicGBall/Client"
> 16:00:16,249 INFO  [LocalConfigStore:config-store] Loaded Configuration
> geronimo.config:name="org/apache/geronimo/ClientCorba"
> 16:00:16,249 INFO  [LocalConfigStore:config-store] Loaded Configuration
> geronimo.config:name="org/apache/geronimo/ClientSecurity"
> 16:00:16,269 INFO  [LocalConfigStore:config-store] Loaded Configuration
> geronimo.config:name="org/apache/geronimo/Client"
> 16:00:16,439 INFO  [Configuration] Started configuration org/apache/geronimo/Client
> 16:00:16,620 INFO  [Configuration] Started configuration
> org/apache/geronimo/ClientSecurity
> 16:00:16,760 INFO  [GeronimoLoginConfiguration] Added Application Configuration Entry
> JMX
> 16:00:16,760 INFO  [GeronimoLoginConfiguration] Added Application Configuration Entry
> geronimo-properties-realm
> 16:00:16,770 INFO  [GeronimoLoginConfiguration] Installed Geronimo login configuration
> 16:00:16,840 INFO  [Configuration] Started configuration
> org/apache/geronimo/ClientCorba
> 16:00:17,451 INFO  [CSSBean] Started CORBA Client Security Server - SSLClientCert
> 16:00:17,471 INFO  [CSSBean] Started CORBA Client Security Server - NoSecurity
> 16:00:17,481 INFO  [CSSBean] Started CORBA Client Security Server - SSLClientPassword
> 16:00:17,541 INFO  [Configuration] Started configuration org/acme/MagicGBall/Client
> 16:00:17,561 INFO  [CommandLine] Server startup completed
> User nameNameCallback returning system.
> PasswordPasswordCallback returning [C@f42160.
> java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
>  at org.apache.geronimo.client.AppClientContainer$1.run(AppClientContainer.java:146)
>  at java.security.AccessController.doPrivileged(Native Method)
>  at javax.security.auth.Subject.doAs(Subject.java:320)
>  at org.apache.geronimo.client.AppClientContainer.main(AppClientContainer.java:139)
>  at
> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
>  at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
>  at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:795)
>  at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:180)
>  at org.apache.geronimo.system.main.CommandLine.invokeMainGBean(CommandLine.java:88)
>  at org.apache.geronimo.system.main.ClientCommandLine.<init>(ClientCommandLine.java:50)
>  at org.apache.geronimo.system.main.ClientCommandLine.main(ClientCommandLine.java:37)
> Caused by: java.lang.reflect.InvocationTargetException
>  at java.lang.reflect.Method.invoke(Method.java:324)
>  at org.apache.geronimo.client.AppClientContainer$1.run(AppClientContainer.java:142)
>  ... 10 more
> Caused by: java.lang.ClassCastException
>  at
>
com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
>  at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
>  at org.acme.MagicGBallClient.ask(MagicGBallClient.java:47)
>  at org.acme.MagicGBallClient.main(MagicGBallClient.java:38)
>  ... 12 more
> 
> And the exception is from the following cast of MagicGBallClient.java:
> 
> Context myEnv = (Context) ctx.lookup("java:comp/env");
> Object objref = myEnv.lookup("mGball");
> MagicGBallHome ejbHome = (MagicGBallHome) PortableRemoteObject.narrow(objref,
> MagicGBallHome.class);
> 
> Any help is appreciated!
> 
> Thanks, Lin
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 



		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by lin sun <li...@yahoo.com>.
--- lin sun <li...@yahoo.com> wrote:

> --- David Jencks <da...@yahoo.com> wrote:
> > Having 2 geronimo servers communicating by corba is definitely possible 
> > and you will be able to configure all the necessary parts using gbeans. 
> >   This would be the easiest to set up in my opinion.   In particular you 
> > should be able to do this now with the existing configurations and 
> > plans, without waiting for me to fix the ClientCORBA plan.   I was 
> > suggesting that you have ejbs deployed on a geronimo server and have 
> > the client be a j2ee application client, running in the geronimo 
> > application client container.  The geronimo app client container is a 
> > stripped down version of geronimo that includes the kernel, the gbean 
> > machinery, the transaction manager, and a few other pieces, but not 
> > ejbs or web apps.  Since it includes the kernel it is fairly easy to 
> > run components in it as gbeans.  This is what I was suggesting.
> 
> > To use an ejb from a j2ee application (such as a j2ee app client, web 
> > app, or ejb) you need to include in the geronimo/openejb plan ejb-ref 
> > information like this:
> > 1. where the naming server is and the name
> > 2. a css-link to supply the security info for csiv2 negotiation with 
> > the server.  A typical element might look like this:
> > 
> >             <ejb-ref>
> >                  <ref-name>ejb/Control</ref-name>
> >                  <ns-corbaloc>corbaloc::<target name service host>:<name 
> > service port>/NameService</ns-corbaloc>
> >                  <name>targetEjbName</name>
> >                  <css-link>SSLClientCert</css-link>
> >              </ejb-ref>
> > (fill in the correct values for the host and port)
> 
> I tried to have the J2EE client and EJB on different machines, but it didn't work.   On
> the client machine, I tried to deploy magicGball-client.jar with the following geronimo
> application deployment plan:
> 
> <application-client
>             xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-client"
>             configId="client"
>             clientConfigId="org/acme/MagicGBall/Client"
>             clientParentId="org/apache/geronimo/ClientCorba">
>             <ejb-ref>
>                 <ref-name>mGBall</ref-name>

This turned out to be a typo.  This should be:  <ref-name>mGball</ref-name> 

Also add the "<jndi-name>" tag under the openejb portion of the geronimo application plan
xml file as below:

<module>
         <ejb>magicGball-ejb.jar</ejb>
         <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar" configId="ejb"
             parentId="org/apache/geronimo/Server">
         <import>
              <uri>org/apache/geronimo/ServerCORBA</uri>
         </import>
             <enterprise-beans>
                 <session>
                     <ejb-name>MagicGBall</ejb-name>
                     <jndi-name>MagicGBall</jndi-name>
                     <tss-link>SSLClientPassword</tss-link>
                 </session>
             </enterprise-beans>
         </openejb-jar>
     </module>

Now I am getting the following exception when I ran the client:

16:00:16,169 INFO  [LocalAttributeManager] Started LocalAttributeManager with data on 10
configurations
16:00:16,239 INFO  [LocalConfigStore:config-store] Loaded Configuration
geronimo.config:name="org/acme/MagicGBall/Client"
16:00:16,249 INFO  [LocalConfigStore:config-store] Loaded Configuration
geronimo.config:name="org/apache/geronimo/ClientCorba"
16:00:16,249 INFO  [LocalConfigStore:config-store] Loaded Configuration
geronimo.config:name="org/apache/geronimo/ClientSecurity"
16:00:16,269 INFO  [LocalConfigStore:config-store] Loaded Configuration
geronimo.config:name="org/apache/geronimo/Client"
16:00:16,439 INFO  [Configuration] Started configuration org/apache/geronimo/Client
16:00:16,620 INFO  [Configuration] Started configuration
org/apache/geronimo/ClientSecurity
16:00:16,760 INFO  [GeronimoLoginConfiguration] Added Application Configuration Entry JMX
16:00:16,760 INFO  [GeronimoLoginConfiguration] Added Application Configuration Entry
geronimo-properties-realm
16:00:16,770 INFO  [GeronimoLoginConfiguration] Installed Geronimo login configuration
16:00:16,840 INFO  [Configuration] Started configuration org/apache/geronimo/ClientCorba
16:00:17,451 INFO  [CSSBean] Started CORBA Client Security Server - SSLClientCert
16:00:17,471 INFO  [CSSBean] Started CORBA Client Security Server - NoSecurity
16:00:17,481 INFO  [CSSBean] Started CORBA Client Security Server - SSLClientPassword
16:00:17,541 INFO  [Configuration] Started configuration org/acme/MagicGBall/Client
16:00:17,561 INFO  [CommandLine] Server startup completed
User nameNameCallback returning system.
PasswordPasswordCallback returning [C@f42160.
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
 at org.apache.geronimo.client.AppClientContainer$1.run(AppClientContainer.java:146)
 at java.security.AccessController.doPrivileged(Native Method)
 at javax.security.auth.Subject.doAs(Subject.java:320)
 at org.apache.geronimo.client.AppClientContainer.main(AppClientContainer.java:139)
 at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
 at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:118)
 at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:795)
 at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:180)
 at org.apache.geronimo.system.main.CommandLine.invokeMainGBean(CommandLine.java:88)
 at org.apache.geronimo.system.main.ClientCommandLine.<init>(ClientCommandLine.java:50)
 at org.apache.geronimo.system.main.ClientCommandLine.main(ClientCommandLine.java:37)
Caused by: java.lang.reflect.InvocationTargetException
 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.apache.geronimo.client.AppClientContainer$1.run(AppClientContainer.java:142)
 ... 10 more
Caused by: java.lang.ClassCastException
 at
com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
 at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
 at org.acme.MagicGBallClient.ask(MagicGBallClient.java:47)
 at org.acme.MagicGBallClient.main(MagicGBallClient.java:38)
 ... 12 more

And the exception is from the following cast of MagicGBallClient.java:

Context myEnv = (Context) ctx.lookup("java:comp/env");
Object objref = myEnv.lookup("mGball");
MagicGBallHome ejbHome = (MagicGBallHome) PortableRemoteObject.narrow(objref,
MagicGBallHome.class);

Any help is appreciated!

Thanks, Lin

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by lin sun <li...@yahoo.com>.
--- David Jencks <da...@yahoo.com> wrote:
> Having 2 geronimo servers communicating by corba is definitely possible 
> and you will be able to configure all the necessary parts using gbeans. 
>   This would be the easiest to set up in my opinion.   In particular you 
> should be able to do this now with the existing configurations and 
> plans, without waiting for me to fix the ClientCORBA plan.   I was 
> suggesting that you have ejbs deployed on a geronimo server and have 
> the client be a j2ee application client, running in the geronimo 
> application client container.  The geronimo app client container is a 
> stripped down version of geronimo that includes the kernel, the gbean 
> machinery, the transaction manager, and a few other pieces, but not 
> ejbs or web apps.  Since it includes the kernel it is fairly easy to 
> run components in it as gbeans.  This is what I was suggesting.

> To use an ejb from a j2ee application (such as a j2ee app client, web 
> app, or ejb) you need to include in the geronimo/openejb plan ejb-ref 
> information like this:
> 1. where the naming server is and the name
> 2. a css-link to supply the security info for csiv2 negotiation with 
> the server.  A typical element might look like this:
> 
>             <ejb-ref>
>                  <ref-name>ejb/Control</ref-name>
>                  <ns-corbaloc>corbaloc::<target name service host>:<name 
> service port>/NameService</ns-corbaloc>
>                  <name>targetEjbName</name>
>                  <css-link>SSLClientCert</css-link>
>              </ejb-ref>
> (fill in the correct values for the host and port)

I tried to have the J2EE client and EJB on different machines, but it didn't work.   On
the client machine, I tried to deploy magicGball-client.jar with the following geronimo
application deployment plan:

<application-client
            xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-client"
            configId="client"
            clientConfigId="org/acme/MagicGBall/Client"
            clientParentId="org/apache/geronimo/ClientCorba">
            <ejb-ref>
                <ref-name>mGBall</ref-name>
               
<ns-corbaloc>corbaloc::<ServerIPAddressHere>:1050/NameService</ns-corbaloc>
                <name>MagicGBall</name>
                <css-link>SSLClientPassword</css-link>
            </ejb-ref>
            <realm-name>geronimo-properties-realm</realm-name>
 
            <callback-handler>org.acme.MagicGBallCallbackHandler</callback-handler>
        </application-client>

However, when I tried to deploy it I got the following error:

C:\svn\server\trunk\geronimo\modules\assembly\target\geronimo-1.0-M5>java -jar b
in\deployer.jar --user system --password manager distribute C:\svn\server\trunk\
geronimo\applications\magicGball\target\magicGball-client.jar C:\svn\server\trun
k\geronimo\applications\magicGball\src\resources\geronimo-application-client.xml
 
    Error: Operation failed: Could not find an EJB for reference mGball
    to a remote session  bean that has the home interface
    org.acme.MagicGBallHome and the remote interface org.acme.MagicGBall

Here's my application client xml plan ( commented out <ejb-link>):

<application-client xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/applicationclient_1_4.xsd"
    version="1.4">
 
    <display-name>Magic G Ball</display-name>
 <ejb-ref>
  <ejb-ref-name>mGball</ejb-ref-name>
  <ejb-ref-type>Session</ejb-ref-type>
  <home>org.acme.MagicGBallHome</home>
  <remote>org.acme.MagicGBall</remote>
  <!-- ejb-link>magicGball-ejb.jar#MagicGBall</ejb-link --> 
 </ejb-ref>
</application-client>

If I deploy the magicgball ear file on both client and server machines and execute the
client from the client machine, the magicGball EJB on the client machine gets invoked.  I
know this because I had each machine print out in the answer from MagicGBallBean ask
method.

> If your j2ee component is running in a server (it is a web app or ejb), 
> you should include the ServerCORBA configuration as a parent, just like 
> for a server ejb.  If your j2ee component is an app client, which runs 
> in a different jvm, you should include the ClientCORBA configuration.  
> Unfortunately the clientCORBA configuration is still incomplete: you 
> need some security gbeans.



thanks, 

Lin

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by lin sun <li...@yahoo.com>.
I decided not to try the no security approach and wait a bit.   I will try my best to
watch the fix from the other lists, but if you could kindly tell me when the missing
security beans are in the HEAD I'd highly appreciate it!

Thanks again, Lin

--- David Jencks <da...@yahoo.com> wrote:

> 
> On Sep 23, 2005, at 12:00 PM, lin sun wrote:
> 
> > Made more progress!!  And Thanks so much AGAIN for your help!
> >
> > The code below works very well, except that I had to use "private 
> > final char[] password =
> > { 'm', 'a', 'n', 'a', 'g', 'e', 'r' };" instead to pass the compiler 
> > error.
> >
> > Now got the following error.   Am I getting the point where the 
> > missing security gbeans
> > on
> >  the app client blocks progress?
> 
> Yes, exactly that point.
> >   If so, do I have to wait for the security gbeans?  Any
> > alternatives?
> 
> You could try using the "NoSecurity" css/tss beans, removing the client 
> CallbackHandler from the xml plan, and removing the reference to 
> SecurityService from the CorbaBean in the ClientCorba plan.  I don't 
> know if it will work :-)
> 
> david jencks
> 
> >
> > E:\geronimo-1.0-SNAPSHOT\geronimo-1.0-SNAPSHOT>java -jar 
> > bin\client.jar org/acme
> > /MagicGBall/Client hi
> > 11:47:57,972 INFO  [ReadOnlyRepository] Repository root is 
> > file:/E:/geronimo-1.0
> > -SNAPSHOT/geronimo-1.0-SNAPSHOT/repository/
> > 11:47:58,163 INFO  [LocalAttributeManager] Started 
> > LocalAttributeManager with da
> > ta on 10 configurations
> > 11:47:58,263 INFO  [LocalConfigStore:config-store] Loaded 
> > Configuration geronimo
> > .config:name="org/acme/MagicGBall/Client"
> > 11:47:58,273 INFO  [LocalConfigStore:config-store] Loaded 
> > Configuration geronimo
> > .config:name="org/apache/geronimo/ClientCorba"
> > 11:47:58,283 INFO  [LocalConfigStore:config-store] Loaded 
> > Configuration geronimo
> > .config:name="org/apache/geronimo/Client"
> > 11:47:58,413 INFO  [Configuration] Started configuration 
> > org/apache/geronimo/Cli
> > ent
> > 11:47:58,643 INFO  [Configuration] Started configuration 
> > org/apache/geronimo/Cli
> > entCorba
> > 11:47:59,214 INFO  [CSSBean] Started CORBA Client Security Server - 
> > SSLClientCer
> > t
> > 11:47:59,234 INFO  [CSSBean] Started CORBA Client Security Server - 
> > NoSecurity
> > 11:47:59,234 INFO  [CSSBean] Started CORBA Client Security Server - 
> > SSLClientPas
> > sword
> > 11:47:59,284 INFO  [Configuration] Started configuration 
> > org/acme/MagicGBall/Cli
> > ent
> > 11:47:59,304 INFO  [CommandLine] Server startup completed
> > java.lang.SecurityException: Unable to locate a login configuration
> >         at com.sun.security.auth.login.ConfigFile.<init>(Unknown 
> > Source)
> >         at java.lang.reflect.Constructor.newInstance(Unknown Source)
> >         at java.lang.Class.newInstance0(Unknown Source)
> >         at java.lang.Class.newInstance(Unknown Source)
> >         at javax.security.auth.login.Configuration$3.run(Unknown 
> > Source)
> >         at java.security.AccessController.doPrivileged(Native Method)
> >         at 
> > javax.security.auth.login.Configuration.getConfiguration(Unknown Sour
> > ce)
> >         at javax.security.auth.login.LoginContext$1.run(Unknown Source)
> >         at java.security.AccessController.doPrivileged(Native Method)
> >         at javax.security.auth.login.LoginContext.init(Unknown Source)
> >         at javax.security.auth.login.LoginContext.<init>(Unknown 
> > Source)
> >         at 
> > org.apache.geronimo.client.AppClientContainer.main(AppClientContainer
> > .java:129)
> >         at 
> > org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethod
> > Invoker.java:38)
> >         at 
> > org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperatio
> > n.java:118)
> >         at 
> > org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.
> > java:795)
> >         at 
> > org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:
> > 180)
> >         at 
> > org.apache.geronimo.system.main.CommandLine.invokeMainGBean(CommandLi
> > ne.java:88)
> >         at 
> > org.apache.geronimo.system.main.ClientCommandLine.<init>(ClientComman
> > dLine.java:50)
> >         at 
> > org.apache.geronimo.system.main.ClientCommandLine.main(ClientCommandL
> > ine.java:37)
> > Caused by: java.io.IOException: Unable to locate a login configuration
> >         at com.sun.security.auth.login.ConfigFile.init(Unknown Source)
> >         ... 19 more
> >
> >
> > --- David Jencks <da...@yahoo.com> wrote:
> >
> >>
> >> On Sep 23, 2005, at 10:55 AM, lin sun wrote:
> >>
> >>> Thanks so much for your help!!   I made some progress!!:-)
> >>>
> >>> The geronimo application plan below is extremely helpful and I was
> >>> able to deploy the new
> >>> plan with only one change (org/apache/geronimo/ClientCORBA ->
> >>> org/apache/geronimo/ClientCorba).
> >>>
> >>> I got the following error when I tried to start the client.  I think
> >>> it is because I
> >>> don't have the org.acme.UPCallbackHandler in place yet. Is there an
> >>> example or
> >>> documentation of this UPCCallbackHandler?
> >>
> >> You have to write it:-)
> >>
> >> Something like this should work, I've hardcoded the user/pw.  For a
> >> real app you would want to get them from the user with a gui or
> >> something or get them from the command line.
> >>
> >> package org.acme;
> >>
> >> import java.io.FileInputStream;
> >> import java.io.IOException;
> >> import java.io.InputStream;
> >> import java.util.Properties;
> >> import javax.security.auth.callback.Callback;
> >> import javax.security.auth.callback.CallbackHandler;
> >> import javax.security.auth.callback.NameCallback;
> >> import javax.security.auth.callback.PasswordCallback;
> >> import javax.security.auth.callback.UnsupportedCallbackException;
> >>
> >> public class UPCallbackHandler implements CallbackHandler {
> >>
> >>      private final String userName = "system";
> >>      private final char[] password = "manager";
> >>
> >>      public void handle(Callback[] callbacks) throws IOException,
> >> UnsupportedCallbackException {
> >>          for (int i = 0; i < callbacks.length; i++) {
> >>              if (callbacks[i] instanceof PasswordCallback) {
> >>                  ((PasswordCallback) 
> >> callbacks[i]).setPassword(password);
> >>              } else if (callbacks[i] instanceof NameCallback) {
> >>                  ((NameCallback) callbacks[i]).setName(userName);
> >>              }
> >>          }
> >>      }
> >>
> >> }
> >>
> >> You are about to get the the point where the missing security gbeans 
> >> on
> >> the app client will block progress.  I have been hoping for several
> >> days to put a plan for these together but have not had time yet.
> >> Perhaps today will be the day.
> >>
> >> thanks
> >> david jencks
> >>
> >>
> >
> >
> > thanks,
> >
> > Lin
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> 
> 



		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by David Jencks <da...@yahoo.com>.
On Sep 23, 2005, at 12:00 PM, lin sun wrote:

> Made more progress!!  And Thanks so much AGAIN for your help!
>
> The code below works very well, except that I had to use "private 
> final char[] password =
> { 'm', 'a', 'n', 'a', 'g', 'e', 'r' };" instead to pass the compiler 
> error.
>
> Now got the following error.   Am I getting the point where the 
> missing security gbeans
> on
>  the app client blocks progress?

Yes, exactly that point.
>   If so, do I have to wait for the security gbeans?  Any
> alternatives?

You could try using the "NoSecurity" css/tss beans, removing the client 
CallbackHandler from the xml plan, and removing the reference to 
SecurityService from the CorbaBean in the ClientCorba plan.  I don't 
know if it will work :-)

david jencks

>
> E:\geronimo-1.0-SNAPSHOT\geronimo-1.0-SNAPSHOT>java -jar 
> bin\client.jar org/acme
> /MagicGBall/Client hi
> 11:47:57,972 INFO  [ReadOnlyRepository] Repository root is 
> file:/E:/geronimo-1.0
> -SNAPSHOT/geronimo-1.0-SNAPSHOT/repository/
> 11:47:58,163 INFO  [LocalAttributeManager] Started 
> LocalAttributeManager with da
> ta on 10 configurations
> 11:47:58,263 INFO  [LocalConfigStore:config-store] Loaded 
> Configuration geronimo
> .config:name="org/acme/MagicGBall/Client"
> 11:47:58,273 INFO  [LocalConfigStore:config-store] Loaded 
> Configuration geronimo
> .config:name="org/apache/geronimo/ClientCorba"
> 11:47:58,283 INFO  [LocalConfigStore:config-store] Loaded 
> Configuration geronimo
> .config:name="org/apache/geronimo/Client"
> 11:47:58,413 INFO  [Configuration] Started configuration 
> org/apache/geronimo/Cli
> ent
> 11:47:58,643 INFO  [Configuration] Started configuration 
> org/apache/geronimo/Cli
> entCorba
> 11:47:59,214 INFO  [CSSBean] Started CORBA Client Security Server - 
> SSLClientCer
> t
> 11:47:59,234 INFO  [CSSBean] Started CORBA Client Security Server - 
> NoSecurity
> 11:47:59,234 INFO  [CSSBean] Started CORBA Client Security Server - 
> SSLClientPas
> sword
> 11:47:59,284 INFO  [Configuration] Started configuration 
> org/acme/MagicGBall/Cli
> ent
> 11:47:59,304 INFO  [CommandLine] Server startup completed
> java.lang.SecurityException: Unable to locate a login configuration
>         at com.sun.security.auth.login.ConfigFile.<init>(Unknown 
> Source)
>         at java.lang.reflect.Constructor.newInstance(Unknown Source)
>         at java.lang.Class.newInstance0(Unknown Source)
>         at java.lang.Class.newInstance(Unknown Source)
>         at javax.security.auth.login.Configuration$3.run(Unknown 
> Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at 
> javax.security.auth.login.Configuration.getConfiguration(Unknown Sour
> ce)
>         at javax.security.auth.login.LoginContext$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at javax.security.auth.login.LoginContext.init(Unknown Source)
>         at javax.security.auth.login.LoginContext.<init>(Unknown 
> Source)
>         at 
> org.apache.geronimo.client.AppClientContainer.main(AppClientContainer
> .java:129)
>         at 
> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethod
> Invoker.java:38)
>         at 
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperatio
> n.java:118)
>         at 
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.
> java:795)
>         at 
> org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:
> 180)
>         at 
> org.apache.geronimo.system.main.CommandLine.invokeMainGBean(CommandLi
> ne.java:88)
>         at 
> org.apache.geronimo.system.main.ClientCommandLine.<init>(ClientComman
> dLine.java:50)
>         at 
> org.apache.geronimo.system.main.ClientCommandLine.main(ClientCommandL
> ine.java:37)
> Caused by: java.io.IOException: Unable to locate a login configuration
>         at com.sun.security.auth.login.ConfigFile.init(Unknown Source)
>         ... 19 more
>
>
> --- David Jencks <da...@yahoo.com> wrote:
>
>>
>> On Sep 23, 2005, at 10:55 AM, lin sun wrote:
>>
>>> Thanks so much for your help!!   I made some progress!!:-)
>>>
>>> The geronimo application plan below is extremely helpful and I was
>>> able to deploy the new
>>> plan with only one change (org/apache/geronimo/ClientCORBA ->
>>> org/apache/geronimo/ClientCorba).
>>>
>>> I got the following error when I tried to start the client.  I think
>>> it is because I
>>> don't have the org.acme.UPCallbackHandler in place yet. Is there an
>>> example or
>>> documentation of this UPCCallbackHandler?
>>
>> You have to write it:-)
>>
>> Something like this should work, I've hardcoded the user/pw.  For a
>> real app you would want to get them from the user with a gui or
>> something or get them from the command line.
>>
>> package org.acme;
>>
>> import java.io.FileInputStream;
>> import java.io.IOException;
>> import java.io.InputStream;
>> import java.util.Properties;
>> import javax.security.auth.callback.Callback;
>> import javax.security.auth.callback.CallbackHandler;
>> import javax.security.auth.callback.NameCallback;
>> import javax.security.auth.callback.PasswordCallback;
>> import javax.security.auth.callback.UnsupportedCallbackException;
>>
>> public class UPCallbackHandler implements CallbackHandler {
>>
>>      private final String userName = "system";
>>      private final char[] password = "manager";
>>
>>      public void handle(Callback[] callbacks) throws IOException,
>> UnsupportedCallbackException {
>>          for (int i = 0; i < callbacks.length; i++) {
>>              if (callbacks[i] instanceof PasswordCallback) {
>>                  ((PasswordCallback) 
>> callbacks[i]).setPassword(password);
>>              } else if (callbacks[i] instanceof NameCallback) {
>>                  ((NameCallback) callbacks[i]).setName(userName);
>>              }
>>          }
>>      }
>>
>> }
>>
>> You are about to get the the point where the missing security gbeans 
>> on
>> the app client will block progress.  I have been hoping for several
>> days to put a plan for these together but have not had time yet.
>> Perhaps today will be the day.
>>
>> thanks
>> david jencks
>>
>>
>
>
> thanks,
>
> Lin
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>


Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by lin sun <li...@yahoo.com>.
Made more progress!!  And Thanks so much AGAIN for your help!

The code below works very well, except that I had to use "private final char[] password =
{ 'm', 'a', 'n', 'a', 'g', 'e', 'r' };" instead to pass the compiler error.

Now got the following error.   Am I getting the point where the missing security gbeans
on 
 the app client blocks progress?   If so, do I have to wait for the security gbeans?  Any
alternatives?

E:\geronimo-1.0-SNAPSHOT\geronimo-1.0-SNAPSHOT>java -jar bin\client.jar org/acme
/MagicGBall/Client hi
11:47:57,972 INFO  [ReadOnlyRepository] Repository root is file:/E:/geronimo-1.0
-SNAPSHOT/geronimo-1.0-SNAPSHOT/repository/
11:47:58,163 INFO  [LocalAttributeManager] Started LocalAttributeManager with da
ta on 10 configurations
11:47:58,263 INFO  [LocalConfigStore:config-store] Loaded Configuration geronimo
.config:name="org/acme/MagicGBall/Client"
11:47:58,273 INFO  [LocalConfigStore:config-store] Loaded Configuration geronimo
.config:name="org/apache/geronimo/ClientCorba"
11:47:58,283 INFO  [LocalConfigStore:config-store] Loaded Configuration geronimo
.config:name="org/apache/geronimo/Client"
11:47:58,413 INFO  [Configuration] Started configuration org/apache/geronimo/Cli
ent
11:47:58,643 INFO  [Configuration] Started configuration org/apache/geronimo/Cli
entCorba
11:47:59,214 INFO  [CSSBean] Started CORBA Client Security Server - SSLClientCer
t
11:47:59,234 INFO  [CSSBean] Started CORBA Client Security Server - NoSecurity
11:47:59,234 INFO  [CSSBean] Started CORBA Client Security Server - SSLClientPas
sword
11:47:59,284 INFO  [Configuration] Started configuration org/acme/MagicGBall/Cli
ent
11:47:59,304 INFO  [CommandLine] Server startup completed
java.lang.SecurityException: Unable to locate a login configuration
        at com.sun.security.auth.login.ConfigFile.<init>(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.lang.Class.newInstance0(Unknown Source)
        at java.lang.Class.newInstance(Unknown Source)
        at javax.security.auth.login.Configuration$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.login.Configuration.getConfiguration(Unknown Sour
ce)
        at javax.security.auth.login.LoginContext$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.login.LoginContext.init(Unknown Source)
        at javax.security.auth.login.LoginContext.<init>(Unknown Source)
        at org.apache.geronimo.client.AppClientContainer.main(AppClientContainer
.java:129)
        at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethod
Invoker.java:38)
        at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperatio
n.java:118)
        at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.
java:795)
        at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:
180)
        at org.apache.geronimo.system.main.CommandLine.invokeMainGBean(CommandLi
ne.java:88)
        at org.apache.geronimo.system.main.ClientCommandLine.<init>(ClientComman
dLine.java:50)
        at org.apache.geronimo.system.main.ClientCommandLine.main(ClientCommandL
ine.java:37)
Caused by: java.io.IOException: Unable to locate a login configuration
        at com.sun.security.auth.login.ConfigFile.init(Unknown Source)
        ... 19 more


--- David Jencks <da...@yahoo.com> wrote:

> 
> On Sep 23, 2005, at 10:55 AM, lin sun wrote:
> 
> > Thanks so much for your help!!   I made some progress!!:-)
> >
> > The geronimo application plan below is extremely helpful and I was 
> > able to deploy the new
> > plan with only one change (org/apache/geronimo/ClientCORBA ->
> > org/apache/geronimo/ClientCorba).
> >
> > I got the following error when I tried to start the client.  I think 
> > it is because I
> > don't have the org.acme.UPCallbackHandler in place yet. Is there an 
> > example or
> > documentation of this UPCCallbackHandler?
> 
> You have to write it:-)
> 
> Something like this should work, I've hardcoded the user/pw.  For a 
> real app you would want to get them from the user with a gui or 
> something or get them from the command line.
> 
> package org.acme;
> 
> import java.io.FileInputStream;
> import java.io.IOException;
> import java.io.InputStream;
> import java.util.Properties;
> import javax.security.auth.callback.Callback;
> import javax.security.auth.callback.CallbackHandler;
> import javax.security.auth.callback.NameCallback;
> import javax.security.auth.callback.PasswordCallback;
> import javax.security.auth.callback.UnsupportedCallbackException;
> 
> public class UPCallbackHandler implements CallbackHandler {
> 
>      private final String userName = "system";
>      private final char[] password = "manager";
> 
>      public void handle(Callback[] callbacks) throws IOException, 
> UnsupportedCallbackException {
>          for (int i = 0; i < callbacks.length; i++) {
>              if (callbacks[i] instanceof PasswordCallback) {
>                  ((PasswordCallback) callbacks[i]).setPassword(password);
>              } else if (callbacks[i] instanceof NameCallback) {
>                  ((NameCallback) callbacks[i]).setName(userName);
>              }
>          }
>      }
> 
> }
> 
> You are about to get the the point where the missing security gbeans on 
> the app client will block progress.  I have been hoping for several 
> days to put a plan for these together but have not had time yet.  
> Perhaps today will be the day.
> 
> thanks
> david jencks
> 
> 


thanks, 

Lin

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by David Jencks <da...@yahoo.com>.
On Sep 23, 2005, at 10:55 AM, lin sun wrote:

> Thanks so much for your help!!   I made some progress!!:-)
>
> The geronimo application plan below is extremely helpful and I was 
> able to deploy the new
> plan with only one change (org/apache/geronimo/ClientCORBA ->
> org/apache/geronimo/ClientCorba).
>
> I got the following error when I tried to start the client.  I think 
> it is because I
> don't have the org.acme.UPCallbackHandler in place yet. Is there an 
> example or
> documentation of this UPCCallbackHandler?

You have to write it:-)

Something like this should work, I've hardcoded the user/pw.  For a 
real app you would want to get them from the user with a gui or 
something or get them from the command line.

package org.acme;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.PasswordCallback;
import javax.security.auth.callback.UnsupportedCallbackException;

public class UPCallbackHandler implements CallbackHandler {

     private final String userName = "system";
     private final char[] password = "manager";

     public void handle(Callback[] callbacks) throws IOException, 
UnsupportedCallbackException {
         for (int i = 0; i < callbacks.length; i++) {
             if (callbacks[i] instanceof PasswordCallback) {
                 ((PasswordCallback) callbacks[i]).setPassword(password);
             } else if (callbacks[i] instanceof NameCallback) {
                 ((NameCallback) callbacks[i]).setName(userName);
             }
         }
     }

}

You are about to get the the point where the missing security gbeans on 
the app client will block progress.  I have been hoping for several 
days to put a plan for these together but have not had time yet.  
Perhaps today will be the day.

thanks
david jencks


Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by lin sun <li...@yahoo.com>.
Thanks so much for your help!!   I made some progress!!:-)

The geronimo application plan below is extremely helpful and I was able to deploy the new
plan with only one change (org/apache/geronimo/ClientCORBA ->
org/apache/geronimo/ClientCorba).

I got the following error when I tried to start the client.  I think it is because I
don't have the org.acme.UPCallbackHandler in place yet. Is there an example or
documentation of this UPCCallbackHandler?

E:\geronimo-1.0-SNAPSHOT\geronimo-1.0-SNAPSHOT>java -jar bin\client.jar org/acme
/MagicGBall/Client hi
10:46:27,446 INFO  [ReadOnlyRepository] Repository root is file:/E:/geronimo-1.0
-SNAPSHOT/geronimo-1.0-SNAPSHOT/repository/
10:46:27,636 INFO  [LocalAttributeManager] Started LocalAttributeManager with da
ta on 10 configurations
10:46:27,726 INFO  [LocalConfigStore:config-store] Loaded Configuration geronimo
.config:name="org/acme/MagicGBall/Client"
10:46:27,736 INFO  [LocalConfigStore:config-store] Loaded Configuration geronimo
.config:name="org/apache/geronimo/ClientCorba"
10:46:27,746 INFO  [LocalConfigStore:config-store] Loaded Configuration geronimo
.config:name="org/apache/geronimo/Client"
10:46:27,886 INFO  [Configuration] Started configuration org/apache/geronimo/Cli
ent
10:46:28,107 INFO  [Configuration] Started configuration org/apache/geronimo/Cli
entCorba
10:46:28,677 INFO  [CSSBean] Started CORBA Client Security Server - SSLClientCer
t
10:46:28,687 INFO  [CSSBean] Started CORBA Client Security Server - NoSecurity
10:46:28,697 INFO  [CSSBean] Started CORBA Client Security Server - SSLClientPas
sword
10:46:28,748 INFO  [Configuration] Started configuration org/acme/MagicGBall/Cli
ent
10:46:28,768 ERROR [GBeanInstanceState] Error while starting; GBean is now in th
e FAILED state: objectName="geronimo.client:type=ClientContainer"
org.apache.geronimo.client.AppClientInitializationException: Could not load call
backHandlerClass
        at org.apache.geronimo.client.AppClientContainer.<init>(AppClientContain
er.java:75)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)





--- David Jencks <da...@yahoo.com> wrote:

> 
> On Sep 22, 2005, at 10:39 PM, lin sun wrote:
> 
> > Thanks again for the quick response and it is very helpful!   Hope I  
> > can get it working
> > any day soon!:-)
> >
> > So I decided to redesign my test scenario based on your  
> > recommendations:
> > 1) Find a J2EE client and EJB sample that would work in geronimo  
> > environment.   Luckily,
> > I was able to get the MagicGball ear file deployed and the  
> > MagicGball-client running in
> > the J2EE client container.   I'd like to use this sample and modify it  
> > so that the J2EE
> > client can communicate to EJBs via IIOP.
> > 2) Customize the EJBs and make them available through Corba
> > 3) Customize the client so that it can use the EJB through Corba
> >
> > I followed your guildance below on No. 2 and No. 3 but I could not get  
> > much further.
> > Could you please help?
> >
> >> To make ejbs available through Corba  (as servers), you need to:
> >> 1. include a tss-link for each ejb in the openejb-plan to a tss bean
> >> that is configured somewhere, such as the j2ee-server-corba-plan.xml
> >> 2. start the j2ee-server-corba-plan.  The easiest way to do this is to
> >> include and "include" element in your openejb plan:
> >>
> >> <include>
> >>      <uri>org/apache/geronimo/ServerCORBA</uri>
> >> </include>
> >
> > I created the openejb-jar.xml file myself, since MagicGball didn't  
> > have one.
> > I could not find much example on <tss-link>...so I assume I can put a  
> > tss bean name like
> > "SSLClientCert" that is specified in the j2ee-server-corba-plan.xml.    
> > Not sure if this
> > is correct, all I know is that the deployer didn't complain:-)
> > I put the <include>..</include> before the <enterprise-beans> but when  
> > I tried to deploy
> > the ear file, the deployer complained that it expected a  
> > <enterprise-beans> tag instead.
> >       Can I just set the parentID to "org/apache/geronimo/ServerCORBA"  
> > to reach the same
> > goal?
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> >     <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar"
> >                      configId="MagicGBall"
> >                      parentId="org/apache/geronimo/Server">
> >
> >     <include>
> >        <uri>org/apache/geronimo/ServerCORBA</uri>
> >     </include>
> >
> >     <enterprise-beans>
> >       <session>
> > 		<ejb-name>MagicGBall</ejb-name>
> > 	        <tss-link>SSLClientCert</tss-link>
> >       </session>
> >     </enterprise-beans>
> >
> >     </openejb-jar>
> >
> >
> my apologies, this should be <import> not <include>  <include> means  
> something very different and is not appropriate for ejb-jars.  I don't  
> think you can use o/a/g/ServerCORBA as the parentId, the openejb  
> classes will be missing :-)
> 
> >> To use an ejb from a j2ee application (such as a j2ee app client, web
> >> app, or ejb) you need to include in the geronimo/openejb plan ejb-ref
> >> information like this:
> >
> > I read Aaron's book on J2EE client application, and I didn't see  
> > anywhere mentions
> > openejb-jar.xml, so I assume you mean geronimo-client.xml here?
> 
> yes.  I don't think his book covers app-clients using corba yet though.
> >
> >> 1. where the naming server is and the name
> >> 2. a css-link to supply the security info for csiv2 negotiation with
> >> the server.  A typical element might look like this:
> >>
> >>             <ejb-ref>
> >>                  <ref-name>ejb/Control</ref-name>
> >>                  <ns-corbaloc>corbaloc::<target name service  
> >> host>:<name
> >> service port>/NameService</ns-corbaloc>
> >>                  <name>targetEjbName</name>
> >>                  <css-link>SSLClientCert</css-link>
> >>              </ejb-ref>
> >> (fill in the correct values for the host and port)
> >
> > I tried to modify the geronimo application client xml file provided by  
> > MagicGball as
> > follows, but the deployer complained the ns-corbaloc, name, css-link  
> > elements were not
> > allowed when I deployed the ear file.
> 
> This is the spec deployment descriptor, which you should not modify.   
> What you should do is write a geronimo application plan that includes  
> modules including the openejb-jar and a geronimo-app-client plan.
> 
> You are going to need to add security to both  the client and ejb.  For  
> the client, you need to supply a callback handler.  The simplest  
> approach is to hardcode the info, either user-pw or certificate.  I  
> think it will be easier to set up server security using user-pw: you  
> can just use the existing properties-login.
> 
> I think something faintly resembling this might work:
> 
> <application
>      xmlns="http://geronimo.apache.org/xml/ns/j2ee/application"
>      configId="org/acme/MagicGball"
>      parentId="org/apache/geronimo/Server">
> 
>      <module>
>          <java>magicGball-client.jar</java>
>          <application-client  
> xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-client"
>              configId="client"
>              clientConfigId="org/acme/MagicGBall/Client"
>              clientParentId="org/apache/geronimo/ClientCORBA">
>              <ejb-ref>
>                  <ref-name>mGBall</ref-name>
>                   
> <ns-corbaloc>corbaloc::localhost:1055/NameService</ns-corbaloc>
>                  <name>MagicGBall</name>
>                  <css-link>SSLClientPassword</css-link>
>              </ejb-ref>
>              <realm-name>geronimo-properties-realm</realm-name>
>               
> <callback-handler>org.acme.UPCallbackHandler</callback-handler>
>          </application-client>
>      </module>
> 
>      <module>
>          <ejb>magicGball-ejb.jar</ejb>
>          <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar"  
> configId="ejb"
>          parentId="org/apache/geronimo/Server">
>          <import>
>               <uri>org/apache/geronimo/ServerCORBA</uri>
>          </import>
>              <enterprise-beans>
>                  <session>
>                      <ejb-name>MagicGBall</ejb-name>
>                      <tss-link>SSLClientPassword</tss-link>
>                  </session>
>              </enterprise-beans>
>          </openejb-jar>
>      </module>
> 
> 
>      <security xmlns="http://geronimo.apache.org/xml/ns/security">
>          <default-principal realm-name="geronimo-properties-realm">
>              <principal  
> class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipa 
> l" name="system"/>
>          </default-principal>
>          <role-mappings>
>              <role role-name="User">
>                  <realm realm-name="geronimo-properties-realm">
>                      <principal  
> class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipa 
> l" name="system"/>
>                  </realm>
>              </role>
>          </role-mappings>
>      </security>
> 
> </application>
> 
> There are probably plenty of mistakes here but this might be a starting  
> point.
> 
> >
> > <application-client xmlns="http://java.sun.com/xml/ns/j2ee"
> >     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> > http://java.sun.com/xml/ns/j2ee/applicationclient_1_4.xsd"
> >     version="1.4">
> >
> >     <display-name>Magic G Ball</display-name>
> > 	<ejb-ref>
> > 		<ejb-ref-name>mGball</ejb-ref-name>
> > 		<ejb-ref-type>Session</ejb-ref-type>
> >                 <home>org.acme.MagicGBallHome</home>
> > 		<remote>org.acme.MagicGBall</remote>
> >                 <ejb-link>magicGball-ejb.jar#MagicGBall</ejb-link>
> >                  
> > <ns-corbaloc>corbaloc::localhost:1050/NameService</ns-corbaloc>
> >                 <name>MagicGBall</name>
> >                 <css-link>SSLClientCert</css-link>
> > 	</ejb-ref>
> > </application-client>
> >
> 
=== message truncated ===


thanks, 

Lin


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by David Jencks <da...@yahoo.com>.
On Sep 22, 2005, at 10:39 PM, lin sun wrote:

> Thanks again for the quick response and it is very helpful!   Hope I  
> can get it working
> any day soon!:-)
>
> So I decided to redesign my test scenario based on your  
> recommendations:
> 1) Find a J2EE client and EJB sample that would work in geronimo  
> environment.   Luckily,
> I was able to get the MagicGball ear file deployed and the  
> MagicGball-client running in
> the J2EE client container.   I'd like to use this sample and modify it  
> so that the J2EE
> client can communicate to EJBs via IIOP.
> 2) Customize the EJBs and make them available through Corba
> 3) Customize the client so that it can use the EJB through Corba
>
> I followed your guildance below on No. 2 and No. 3 but I could not get  
> much further.
> Could you please help?
>
>> To make ejbs available through Corba  (as servers), you need to:
>> 1. include a tss-link for each ejb in the openejb-plan to a tss bean
>> that is configured somewhere, such as the j2ee-server-corba-plan.xml
>> 2. start the j2ee-server-corba-plan.  The easiest way to do this is to
>> include and "include" element in your openejb plan:
>>
>> <include>
>>      <uri>org/apache/geronimo/ServerCORBA</uri>
>> </include>
>
> I created the openejb-jar.xml file myself, since MagicGball didn't  
> have one.
> I could not find much example on <tss-link>...so I assume I can put a  
> tss bean name like
> "SSLClientCert" that is specified in the j2ee-server-corba-plan.xml.    
> Not sure if this
> is correct, all I know is that the deployer didn't complain:-)
> I put the <include>..</include> before the <enterprise-beans> but when  
> I tried to deploy
> the ear file, the deployer complained that it expected a  
> <enterprise-beans> tag instead.
>       Can I just set the parentID to "org/apache/geronimo/ServerCORBA"  
> to reach the same
> goal?
>
> <?xml version="1.0" encoding="UTF-8"?>
>
>     <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar"
>                      configId="MagicGBall"
>                      parentId="org/apache/geronimo/Server">
>
>     <include>
>        <uri>org/apache/geronimo/ServerCORBA</uri>
>     </include>
>
>     <enterprise-beans>
>       <session>
> 		<ejb-name>MagicGBall</ejb-name>
> 	        <tss-link>SSLClientCert</tss-link>
>       </session>
>     </enterprise-beans>
>
>     </openejb-jar>
>
>
my apologies, this should be <import> not <include>  <include> means  
something very different and is not appropriate for ejb-jars.  I don't  
think you can use o/a/g/ServerCORBA as the parentId, the openejb  
classes will be missing :-)

>> To use an ejb from a j2ee application (such as a j2ee app client, web
>> app, or ejb) you need to include in the geronimo/openejb plan ejb-ref
>> information like this:
>
> I read Aaron's book on J2EE client application, and I didn't see  
> anywhere mentions
> openejb-jar.xml, so I assume you mean geronimo-client.xml here?

yes.  I don't think his book covers app-clients using corba yet though.
>
>> 1. where the naming server is and the name
>> 2. a css-link to supply the security info for csiv2 negotiation with
>> the server.  A typical element might look like this:
>>
>>             <ejb-ref>
>>                  <ref-name>ejb/Control</ref-name>
>>                  <ns-corbaloc>corbaloc::<target name service  
>> host>:<name
>> service port>/NameService</ns-corbaloc>
>>                  <name>targetEjbName</name>
>>                  <css-link>SSLClientCert</css-link>
>>              </ejb-ref>
>> (fill in the correct values for the host and port)
>
> I tried to modify the geronimo application client xml file provided by  
> MagicGball as
> follows, but the deployer complained the ns-corbaloc, name, css-link  
> elements were not
> allowed when I deployed the ear file.

This is the spec deployment descriptor, which you should not modify.   
What you should do is write a geronimo application plan that includes  
modules including the openejb-jar and a geronimo-app-client plan.

You are going to need to add security to both  the client and ejb.  For  
the client, you need to supply a callback handler.  The simplest  
approach is to hardcode the info, either user-pw or certificate.  I  
think it will be easier to set up server security using user-pw: you  
can just use the existing properties-login.

I think something faintly resembling this might work:

<application
     xmlns="http://geronimo.apache.org/xml/ns/j2ee/application"
     configId="org/acme/MagicGball"
     parentId="org/apache/geronimo/Server">

     <module>
         <java>magicGball-client.jar</java>
         <application-client  
xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-client"
             configId="client"
             clientConfigId="org/acme/MagicGBall/Client"
             clientParentId="org/apache/geronimo/ClientCORBA">
             <ejb-ref>
                 <ref-name>mGBall</ref-name>
                  
<ns-corbaloc>corbaloc::localhost:1055/NameService</ns-corbaloc>
                 <name>MagicGBall</name>
                 <css-link>SSLClientPassword</css-link>
             </ejb-ref>
             <realm-name>geronimo-properties-realm</realm-name>
              
<callback-handler>org.acme.UPCallbackHandler</callback-handler>
         </application-client>
     </module>

     <module>
         <ejb>magicGball-ejb.jar</ejb>
         <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar"  
configId="ejb"
         parentId="org/apache/geronimo/Server">
         <import>
              <uri>org/apache/geronimo/ServerCORBA</uri>
         </import>
             <enterprise-beans>
                 <session>
                     <ejb-name>MagicGBall</ejb-name>
                     <tss-link>SSLClientPassword</tss-link>
                 </session>
             </enterprise-beans>
         </openejb-jar>
     </module>


     <security xmlns="http://geronimo.apache.org/xml/ns/security">
         <default-principal realm-name="geronimo-properties-realm">
             <principal  
class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipa 
l" name="system"/>
         </default-principal>
         <role-mappings>
             <role role-name="User">
                 <realm realm-name="geronimo-properties-realm">
                     <principal  
class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipa 
l" name="system"/>
                 </realm>
             </role>
         </role-mappings>
     </security>

</application>

There are probably plenty of mistakes here but this might be a starting  
point.

>
> <application-client xmlns="http://java.sun.com/xml/ns/j2ee"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/applicationclient_1_4.xsd"
>     version="1.4">
>
>     <display-name>Magic G Ball</display-name>
> 	<ejb-ref>
> 		<ejb-ref-name>mGball</ejb-ref-name>
> 		<ejb-ref-type>Session</ejb-ref-type>
>                 <home>org.acme.MagicGBallHome</home>
> 		<remote>org.acme.MagicGBall</remote>
>                 <ejb-link>magicGball-ejb.jar#MagicGBall</ejb-link>
>                  
> <ns-corbaloc>corbaloc::localhost:1050/NameService</ns-corbaloc>
>                 <name>MagicGBall</name>
>                 <css-link>SSLClientCert</css-link>
> 	</ejb-ref>
> </application-client>
>
> Deployer error:
> E:\geronimo-1.0-SNAPSHOT\geronimo-1.0-SNAPSHOT>java -jar  
> bin\deployer.jar --user
>  system --password manager deploy  
> \build\geronimo\applications\magicGball\target
> \magicGball.ear
>     Error: Unable to distribute magicGball.ear: Unable to parse
>     application-client.xml caused by Invalid deployment descriptor:
>     [error: cvc-complex-type.2.4b: Element not allowed:
>     ns-corbaloc@http://java.sun.com/xml/ns/j2ee in element
>     ejb-ref@http://java.sun.com/xml/ns/j2ee, error:
>     cvc-complex-type.2.4b: Element not allowed:
>     name@http://java.sun.com/xml/ns/j2ee in element
>     ejb-ref@http://java.sun.com/xml/ns/j2ee, error:
>     cvc-complex-type.2.4b: Element not allowed:
>     css-link@http://java.sun.com/xml/ns/j2ee in element
>     ejb-ref@http://java.sun.com/xml/ns/j2ee]
>
>
>
>> If your j2ee component is running in a server (it is a web app or  
>> ejb),
>> you should include the ServerCORBA configuration as a parent, just  
>> like
>> for a server ejb.  If your j2ee component is an app client, which runs
>> in a different jvm, you should include the ClientCORBA configuration.
>> Unfortunately the clientCORBA configuration is still incomplete: you
>> need some security gbeans.
>
> I think I need to change the ask(String question) method in  
> MagicGBallClient.java use
> Corba.   I am a bit lost here on what parm would ic.lookup() take?    
> Since I could have
> define them via the ns-corbaloc tag.
>
>         //linsun: look up MagicGBallHome in the naming context
>         InitialContext ic = new InitialContext();
>         Object mgbObj =  
> ic.lookup("corbaname::localhost:1050/NameService");

you should look up the string java:comp/env/mGball just like in the  
original, and specify the name server location in the geronimo plan.
>
>         //linsun: perform a safe downcast
>         MagicGBallHome home =
> (MagicGBallHome)PortableRemoteObject.narrow(mgbObj,MagicGBallHome.class 
> );
you need to do this.
>
>         //from the original sample
>         MagicGBall mGball = home.create();
>         String answer = mGball.ask(question);
I think this part should be OK.
>
>
>> Finally, to use a ejb from a non-j2ee application through CORBA you
>> need to set up most of the infrastructure that the gbeans set up for
>> you: at least the Orb, the dynamic stub classloader, and some CSS
>> implementation.  This last part is something no one has tried yet as
>> far as I know.
>>
>> On the other hand, if you can find someone elses example of a
>> standalone non-j2ee client that accesses ejbs using csiv2 security  
>> over
>> CORBA you should be able to communicate with those ejbs deployed in
>> geronimo.  However, I've never seen such an example.
>
> Gave up this approach--don't want to run into too much surprises!:-)
:-)  there will be plenty of surprises anyway!

thanks
david jencks


Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by lin sun <li...@yahoo.com>.
Thanks again for the quick response and it is very helpful!   Hope I can get it working
any day soon!:-)

So I decided to redesign my test scenario based on your recommendations:
1) Find a J2EE client and EJB sample that would work in geronimo environment.   Luckily,
I was able to get the MagicGball ear file deployed and the MagicGball-client running in
the J2EE client container.   I'd like to use this sample and modify it so that the J2EE
client can communicate to EJBs via IIOP.
2) Customize the EJBs and make them available through Corba
3) Customize the client so that it can use the EJB through Corba

I followed your guildance below on No. 2 and No. 3 but I could not get much further.  
Could you please help?  

> To make ejbs available through Corba  (as servers), you need to:
> 1. include a tss-link for each ejb in the openejb-plan to a tss bean 
> that is configured somewhere, such as the j2ee-server-corba-plan.xml
> 2. start the j2ee-server-corba-plan.  The easiest way to do this is to 
> include and "include" element in your openejb plan:
> 
> <include>
>      <uri>org/apache/geronimo/ServerCORBA</uri>
> </include>

I created the openejb-jar.xml file myself, since MagicGball didn't have one.   
I could not find much example on <tss-link>...so I assume I can put a tss bean name like
"SSLClientCert" that is specified in the j2ee-server-corba-plan.xml.   Not sure if this
is correct, all I know is that the deployer didn't complain:-) 
I put the <include>..</include> before the <enterprise-beans> but when I tried to deploy
the ear file, the deployer complained that it expected a <enterprise-beans> tag instead. 
      Can I just set the parentID to "org/apache/geronimo/ServerCORBA" to reach the same
goal?   
 
<?xml version="1.0" encoding="UTF-8"?>

    <openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar"
                     configId="MagicGBall"
                     parentId="org/apache/geronimo/Server">

    <include>
       <uri>org/apache/geronimo/ServerCORBA</uri>
    </include> 

    <enterprise-beans>
      <session>
		<ejb-name>MagicGBall</ejb-name>
	        <tss-link>SSLClientCert</tss-link>            
      </session>
    </enterprise-beans>

    </openejb-jar>


> To use an ejb from a j2ee application (such as a j2ee app client, web 
> app, or ejb) you need to include in the geronimo/openejb plan ejb-ref 
> information like this:

I read Aaron's book on J2EE client application, and I didn't see anywhere mentions
openejb-jar.xml, so I assume you mean geronimo-client.xml here?

> 1. where the naming server is and the name
> 2. a css-link to supply the security info for csiv2 negotiation with 
> the server.  A typical element might look like this:
> 
>             <ejb-ref>
>                  <ref-name>ejb/Control</ref-name>
>                  <ns-corbaloc>corbaloc::<target name service host>:<name 
> service port>/NameService</ns-corbaloc>
>                  <name>targetEjbName</name>
>                  <css-link>SSLClientCert</css-link>
>              </ejb-ref>
> (fill in the correct values for the host and port)

I tried to modify the geronimo application client xml file provided by MagicGball as
follows, but the deployer complained the ns-corbaloc, name, css-link elements were not
allowed when I deployed the ear file.
 
<application-client xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/applicationclient_1_4.xsd"
    version="1.4">

    <display-name>Magic G Ball</display-name>
	<ejb-ref>
		<ejb-ref-name>mGball</ejb-ref-name>
		<ejb-ref-type>Session</ejb-ref-type>
                <home>org.acme.MagicGBallHome</home>
		<remote>org.acme.MagicGBall</remote>
                <ejb-link>magicGball-ejb.jar#MagicGBall</ejb-link> 
                <ns-corbaloc>corbaloc::localhost:1050/NameService</ns-corbaloc>
                <name>MagicGBall</name>      
                <css-link>SSLClientCert</css-link> 
	</ejb-ref>
</application-client>

Deployer error:
E:\geronimo-1.0-SNAPSHOT\geronimo-1.0-SNAPSHOT>java -jar bin\deployer.jar --user
 system --password manager deploy \build\geronimo\applications\magicGball\target
\magicGball.ear
    Error: Unable to distribute magicGball.ear: Unable to parse
    application-client.xml caused by Invalid deployment descriptor:
    [error: cvc-complex-type.2.4b: Element not allowed:
    ns-corbaloc@http://java.sun.com/xml/ns/j2ee in element
    ejb-ref@http://java.sun.com/xml/ns/j2ee, error:
    cvc-complex-type.2.4b: Element not allowed:
    name@http://java.sun.com/xml/ns/j2ee in element
    ejb-ref@http://java.sun.com/xml/ns/j2ee, error:
    cvc-complex-type.2.4b: Element not allowed:
    css-link@http://java.sun.com/xml/ns/j2ee in element
    ejb-ref@http://java.sun.com/xml/ns/j2ee]



> If your j2ee component is running in a server (it is a web app or ejb), 
> you should include the ServerCORBA configuration as a parent, just like 
> for a server ejb.  If your j2ee component is an app client, which runs 
> in a different jvm, you should include the ClientCORBA configuration.  
> Unfortunately the clientCORBA configuration is still incomplete: you 
> need some security gbeans.

I think I need to change the ask(String question) method in MagicGBallClient.java use
Corba.   I am a bit lost here on what parm would ic.lookup() take?   Since I could have
define them via the ns-corbaloc tag.

        //linsun: look up MagicGBallHome in the naming context
        InitialContext ic = new InitialContext();
        Object mgbObj = ic.lookup("corbaname::localhost:1050/NameService");   

        //linsun: perform a safe downcast
        MagicGBallHome home =
(MagicGBallHome)PortableRemoteObject.narrow(mgbObj,MagicGBallHome.class);

        //from the original sample
        MagicGBall mGball = home.create();
        String answer = mGball.ask(question);  


> Finally, to use a ejb from a non-j2ee application through CORBA you 
> need to set up most of the infrastructure that the gbeans set up for 
> you: at least the Orb, the dynamic stub classloader, and some CSS 
> implementation.  This last part is something no one has tried yet as 
> far as I know.
> 
> On the other hand, if you can find someone elses example of a 
> standalone non-j2ee client that accesses ejbs using csiv2 security over 
> CORBA you should be able to communicate with those ejbs deployed in 
> geronimo.  However, I've never seen such an example.

Gave up this approach--don't want to run into too much surprises!:-)

thanks, 

Lin


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by David Jencks <da...@yahoo.com>.
On Sep 21, 2005, at 11:03 PM, lin sun wrote:

> --- David Jencks <da...@yahoo.com> wrote:
>
>> 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.
>
> Are you suggesting both J2EE-Corba client and EJB running in the same 
> geronimo server and
> they communicate each other via IIOP?

no
>   I had thought that would not be using IIOP
> initially...  Or you are suggesting 2 geronimo servers on two 
> machines, one has the
> J2EE-Corba client running, the other one has the EJB running?   I 
> would prefer the later
> one.

Having 2 geronimo servers communicating by corba is definitely possible 
and you will be able to configure all the necessary parts using gbeans. 
  This would be the easiest to set up in my opinion.   In particular you 
should be able to do this now with the existing configurations and 
plans, without waiting for me to fix the ClientCORBA plan.   I was 
suggesting that you have ejbs deployed on a geronimo server and have 
the client be a j2ee application client, running in the geronimo 
application client container.  The geronimo app client container is a 
stripped down version of geronimo that includes the kernel, the gbean 
machinery, the transaction manager, and a few other pieces, but not 
ejbs or web apps.  Since it includes the kernel it is fairly easy to 
run components in it as gbeans.  This is what I was suggesting.
>>
>> 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 actually want to use IIOP via SSL... I mentioned setup without it 
> because you said you
> are too busy to write some docs on how to setup it.

SSL shouldn't really be any harder than "no security" as long as you 
stick to the example css and tss beans or equivalent configurations set 
up in code.
>
>> Well, we don't really need any server side code generation but the
>> client side would be done with a cglib proxy.
>
> Good to know that thanks!
>
>> This is all good, but IIUC not sufficient.
>
> This might be too obvious for others, but what does IIUC mean?

If I Understand Correctly :-)  I've been spending too much time writing 
email and on IRC :-)
>
>> I believe you need an orb running on the client.  In the geronimo app
>> client, this comes from these two gbeans:
>>
>>      <gbean name="DyanmicStubClassLoader"
>> class="org.openejb.corba.util.DynamicStubClassLoader"/>
>>
>>      <gbean name="Server" class="org.openejb.corba.CORBABean">
>>          <reference name="ThreadPool">
>>              <module>org/apache/geronimo/Client</module>
>>              <name>DefaultThreadPool</name>
>>          </reference>
>>          <reference name="SecurityService">
>>              <module>*</module>
>>              <name>SecurityService</name>
>>          </reference>
>>          <attribute name="args">-ORBPort, 9683, -ORBInitRef,
>> NameService=corbaloc::localhost:2809/NameService</attribute>
>>          <attribute name="props">
>>              com.sun.CORBA.ORBServerHost=localhost
>>          </attribute>
>>      </gbean>
>>
>>
>> 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">
>>              <module>org/apache/geronimo/Client</module>
>>              <name>DefaultThreadPool</name>
>>          </reference>
>>          <reference name="TransactionContextManager">
>>              <module>org/apache/geronimo/Client</module>
>>              <name>TransactionContextManager</name>
>>          </reference>
>>          <attribute
>> name="configAdapter">org.openejb.corba.sunorb.SunORBConfigAdapter</
>> attribute>
>>          <attribute name="description">NoSecurity</attribute>
>>          <attribute name="cssArgs"></attribute>
>>          <xml-attribute name="cssConfig">
>>              <css:css
>> xmlns:css="http://www.openejb.org/xml/ns/corba-css-config_1_0">
>>                  <css:compoundSecMechTypeList>
>>                      <css:compoundSecMech>
>>                          <css:SSL>
>>                              <css:supports>Integrity Confidentiality
>> EstablishTrustInTarget EstablishTrustInClient</css:supports>
>>                              <css:requires></css:requires>
>>                          </css:SSL>
>>                      </css:compoundSecMech>
>>                  </css:compoundSecMechTypeList>
>>              </css:css>
>>          </xml-attribute>
>>      </gbean>
>>
>> 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.
>
> I am lost here.   I thought I only need to create a J2EE-Corba 
> application and deploy it
> to geronimo client container.   My understanding is the GBean would be 
> generated by the
> deployer automatically.   Also, I noticed the Gbean configuration you 
> mentioned to me are
> from doc\plan\j2EE-corba-client-plan.xml.  Maybe I could leverage this 
> corba client
> provided by Geronimo just to get end to end flow running?

There are lots of gbeans :-)  When you deploy a j2ee app on geronimo 
the builders will generate gbean descriptions that implement the 
functionality of your application by wrapping the classes you provide 
and setting up support services.  However, these all depend on "basic" 
services that run in geronimo.  Since lots of people aren't very 
interested in corba we've put the corba gbeans in separate plans that 
you don't have to run.  So...

To make ejbs available through Corba  (as servers), you need to:
1. include a tss-link for each ejb in the openejb-plan to a tss bean 
that is configured somewhere, such as the j2ee-server-corba-plan.xml
2. start the j2ee-server-corba-plan.  The easiest way to do this is to 
include and "include" element in your openejb plan:

<include>
     <uri>org/apache/geronimo/ServerCORBA</uri>
</include>

To use an ejb from a j2ee application (such as a j2ee app client, web 
app, or ejb) you need to include in the geronimo/openejb plan ejb-ref 
information like this:
1. where the naming server is and the name
2. a css-link to supply the security info for csiv2 negotiation with 
the server.  A typical element might look like this:

            <ejb-ref>
                 <ref-name>ejb/Control</ref-name>
                 <ns-corbaloc>corbaloc::<target name service host>:<name 
service port>/NameService</ns-corbaloc>
                 <name>targetEjbName</name>
                 <css-link>SSLClientCert</css-link>
             </ejb-ref>
(fill in the correct values for the host and port)

If your j2ee component is running in a server (it is a web app or ejb), 
you should include the ServerCORBA configuration as a parent, just like 
for a server ejb.  If your j2ee component is an app client, which runs 
in a different jvm, you should include the ClientCORBA configuration.  
Unfortunately the clientCORBA configuration is still incomplete: you 
need some security gbeans.

Finally, to use a ejb from a non-j2ee application through CORBA you 
need to set up most of the infrastructure that the gbeans set up for 
you: at least the Orb, the dynamic stub classloader, and some CSS 
implementation.  This last part is something no one has tried yet as 
far as I know.

On the other hand, if you can find someone elses example of a 
standalone non-j2ee client that accesses ejbs using csiv2 security over 
CORBA you should be able to communicate with those ejbs deployed in 
geronimo.  However, I've never seen such an example.

thanks
david jencks


Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by lin sun <li...@yahoo.com>.
--- David Jencks <da...@yahoo.com> wrote:

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

Are you suggesting both J2EE-Corba client and EJB running in the same geronimo server and
they communicate each other via IIOP?   I had thought that would not be using IIOP
initially...  Or you are suggesting 2 geronimo servers on two machines, one has the
J2EE-Corba client running, the other one has the EJB running?   I would prefer the later
one.
> 
> 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 actually want to use IIOP via SSL... I mentioned setup without it because you said you
are too busy to write some docs on how to setup it.

> Well, we don't really need any server side code generation but the  
> client side would be done with a cglib proxy.

Good to know that thanks! 

> This is all good, but IIUC not sufficient.

This might be too obvious for others, but what does IIUC mean?

> I believe you need an orb running on the client.  In the geronimo app  
> client, this comes from these two gbeans:
> 
>      <gbean name="DyanmicStubClassLoader"  
> class="org.openejb.corba.util.DynamicStubClassLoader"/>
> 
>      <gbean name="Server" class="org.openejb.corba.CORBABean">
>          <reference name="ThreadPool">
>              <module>org/apache/geronimo/Client</module>
>              <name>DefaultThreadPool</name>
>          </reference>
>          <reference name="SecurityService">
>              <module>*</module>
>              <name>SecurityService</name>
>          </reference>
>          <attribute name="args">-ORBPort, 9683, -ORBInitRef,  
> NameService=corbaloc::localhost:2809/NameService</attribute>
>          <attribute name="props">
>              com.sun.CORBA.ORBServerHost=localhost
>          </attribute>
>      </gbean>
> 
> 
> 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">
>              <module>org/apache/geronimo/Client</module>
>              <name>DefaultThreadPool</name>
>          </reference>
>          <reference name="TransactionContextManager">
>              <module>org/apache/geronimo/Client</module>
>              <name>TransactionContextManager</name>
>          </reference>
>          <attribute  
> name="configAdapter">org.openejb.corba.sunorb.SunORBConfigAdapter</ 
> attribute>
>          <attribute name="description">NoSecurity</attribute>
>          <attribute name="cssArgs"></attribute>
>          <xml-attribute name="cssConfig">
>              <css:css  
> xmlns:css="http://www.openejb.org/xml/ns/corba-css-config_1_0">
>                  <css:compoundSecMechTypeList>
>                      <css:compoundSecMech>
>                          <css:SSL>
>                              <css:supports>Integrity Confidentiality  
> EstablishTrustInTarget EstablishTrustInClient</css:supports>
>                              <css:requires></css:requires>
>                          </css:SSL>
>                      </css:compoundSecMech>
>                  </css:compoundSecMechTypeList>
>              </css:css>
>          </xml-attribute>
>      </gbean>
> 
> 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.

I am lost here.   I thought I only need to create a J2EE-Corba application and deploy it
to geronimo client container.   My understanding is the GBean would be generated by the
deployer automatically.   Also, I noticed the Gbean configuration you mentioned to me are
from doc\plan\j2EE-corba-client-plan.xml.  Maybe I could leverage this corba client
provided by Geronimo just to get end to end flow running?

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

Very helpful and thanks again!  Lin
> 
> thanks
> david jencks
> 
> 



	
		
______________________________________________________ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 


Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by David Jencks <da...@yahoo.com>.
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"  
class="org.openejb.corba.util.DynamicStubClassLoader"/>

     <gbean name="Server" class="org.openejb.corba.CORBABean">
         <reference name="ThreadPool">
             <module>org/apache/geronimo/Client</module>
             <name>DefaultThreadPool</name>
         </reference>
         <reference name="SecurityService">
             <module>*</module>
             <name>SecurityService</name>
         </reference>
         <attribute name="args">-ORBPort, 9683, -ORBInitRef,  
NameService=corbaloc::localhost:2809/NameService</attribute>
         <attribute name="props">
             com.sun.CORBA.ORBServerHost=localhost
         </attribute>
     </gbean>


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">
             <module>org/apache/geronimo/Client</module>
             <name>DefaultThreadPool</name>
         </reference>
         <reference name="TransactionContextManager">
             <module>org/apache/geronimo/Client</module>
             <name>TransactionContextManager</name>
         </reference>
         <attribute  
name="configAdapter">org.openejb.corba.sunorb.SunORBConfigAdapter</ 
attribute>
         <attribute name="description">NoSecurity</attribute>
         <attribute name="cssArgs"></attribute>
         <xml-attribute name="cssConfig">
             <css:css  
xmlns:css="http://www.openejb.org/xml/ns/corba-css-config_1_0">
                 <css:compoundSecMechTypeList>
                     <css:compoundSecMech>
                         <css:SSL>
                             <css:supports>Integrity Confidentiality  
EstablishTrustInTarget EstablishTrustInClient</css:supports>
                             <css:requires></css:requires>
                         </css:SSL>
                     </css:compoundSecMech>
                 </css:compoundSecMechTypeList>
             </css:css>
         </xml-attribute>
     </gbean>

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.

thanks
david jencks


>
> --- David Jencks <da...@yahoo.com> 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 <ke...@gmail.com> 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 <li...@yahoo.com> 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:
>>>>>
>> IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
>>>>>
>>>>> The client app failed at ctx.lookup(JNDI_NAME)
>> and
>>>>> I've made sure that I specified the same
>> JNDI_NAME
>>>> 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
>>>>> http://mail.yahoo.com
>>>>>
>>>>
>>>>
>>>> -- 
>>>> perl -e 'print
>>>> unpack(u,"62V5N\"FME;G\!E<FQ`9VUA:6PN8V]M\"\@``
>>>> ")'
>>>>
>>>
>>>
>>> thanks,
>>>
>>> Lin
>>>
>>>
>>> 		
>>> __________________________________
>>> Yahoo! Mail - PC Magazine Editors' Choice 2005
>>> http://mail.yahoo.com
>>>
>>
>>
>
>
> thanks,
>
> Lin
>
>
> 		
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>


Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by lin sun <li...@yahoo.com>.
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?  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 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.
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.

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.

--- David Jencks <da...@yahoo.com> 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 <ke...@gmail.com> 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 <li...@yahoo.com> 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:
> >>>
> IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
> >>>
> >>> The client app failed at ctx.lookup(JNDI_NAME)
> and
> >>> I've made sure that I specified the same
> JNDI_NAME
> >> 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
> >>> http://mail.yahoo.com
> >>>
> >>
> >>
> >> -- 
> >> perl -e 'print
> >> unpack(u,"62V5N\"FME;G\!E<FQ`9VUA:6PN8V]M\"\@``
> >> ")'
> >>
> >
> >
> > thanks,
> >
> > Lin
> >
> >
> > 		
> > __________________________________
> > Yahoo! Mail - PC Magazine Editors' Choice 2005
> > http://mail.yahoo.com
> >
> 
> 


thanks, 

Lin


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by David Jencks <da...@yahoo.com>.
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 <ke...@gmail.com> 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 <li...@yahoo.com> 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:
>>> IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
>>>
>>> The client app failed at ctx.lookup(JNDI_NAME) and
>>> I've made sure that I specified the same JNDI_NAME
>> 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
>>> http://mail.yahoo.com
>>>
>>
>>
>> -- 
>> perl -e 'print
>> unpack(u,"62V5N\"FME;G\!E<FQ`9VUA:6PN8V]M\"\@``
>> ")'
>>
>
>
> thanks,
>
> Lin
>
>
> 		
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>


Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by lin sun <li...@yahoo.com>.
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 <ke...@gmail.com> 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 <li...@yahoo.com> 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:
> > IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
> > 
> > The client app failed at ctx.lookup(JNDI_NAME) and
> > I've made sure that I specified the same JNDI_NAME
> 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.CNCtxFactory");
> >       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
> > http://mail.yahoo.com
> > 
> 
> 
> -- 
> perl -e 'print
> unpack(u,"62V5N\"FME;G\!E<FQ`9VUA:6PN8V]M\"\@``
> ")'
> 


thanks, 

Lin


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

Re: org.omg.CosNaming.NamingCntextPackage.NotFound

Posted by Ken Perl <ke...@gmail.com>.
I guess the client is providing the wrong URL, try to use 1099 instead
of iiop://localhost:1050.

On 9/20/05, lin sun <li...@yahoo.com> 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:
> IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
> 
> The client app failed at ctx.lookup(JNDI_NAME) and
> I've made sure that I specified the same JNDI_NAME 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.CNCtxFactory");
>       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
> http://mail.yahoo.com
> 


-- 
perl -e 'print unpack(u,"62V5N\"FME;G\!E<FQ`9VUA:6PN8V]M\"\@``
")'