You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Jean-Sebastien Delfino <js...@apache.org> on 2008/03/27 18:00:26 UTC

Corbaname of an EJB3 session bean

Given the following EJB3 session bean, deployed to Geronimo v2.1:

@Stateless(name="MyCatalogEJB")
public class MyCatalogEJBImpl implements CatalogEJB {
...
}

Having been able to lookup that EJB from a J2SE client as follows:

Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
   "org.apache.openejb.client.RemoteInitialContextFactory");
properties.setProperty(Context.PROVIDER_URL,
   "ejbd://localhost:4201");

InitialContext context = new InitialContext(properties);

CatalogEJB catalog = (CatalogEJB)
   context.lookup("java:CatalogEJBRemote");

I would like to look it up using CosNaming, something like that:

InitialContext context = new InitialContext();
CatalogEJB catalog = (CatalogEJB)
   context.lookup("corbaname:iiop:1.2@localhost:1050#CatalogEJBRemote");

but whatever name I try I always get the same exception:

Exception in thread "main" javax.naming.NameNotFoundException [Root 
exception is org.omg.CosNaming.NamingContextPackage.NotFound: 
IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
	at 
com.sun.jndi.cosnaming.ExceptionMapper.mapException(ExceptionMapper.java:44)
	at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:484)
	at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:523)
	at 
com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
	at javax.naming.InitialContext.lookup(InitialContext.java:392)
	at client.Client.main(Client.java:24)
Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: 
IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
	at 
org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
	at 
org.omg.CosNaming._NamingContextStub.resolve(_NamingContextStub.java:251)
	at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:470)
	... 4 more


Any idea of what I'm missing? Thanks.
-- 
Jean-Sebastien

Re: Corbaname of an EJB3 session bean

Posted by Jean-Sebastien Delfino <js...@apache.org>.
David Jencks wrote:
> You have to set up a TSSGBean to configure the csiv2 security for your 
> ejb and add  a TSSLink gbean to associate the ejb with the security config.
> 
> I think there's a fairly complete example in the testsuite.
> 
> hope this helps
> david jencks
> 

Thanks, I am now able to activate an EJB 2.1 session bean as a CORBA 
object after following the corba example [1] from the test suite.

The same configuration with an EJB 3 fails to start with the following:

org.apache.geronimo.corba.CORBAException: Unable to activate EJB as 
CORBA object
at org.apache.geronimo.corba.Adapter.<init>(Adapter.java:100)
         at 
org.apache.geronimo.corba.AdapterStateless.<init>(AdapterStateless.java:41)
         at 
org.apache.geronimo.corba.AdapterWrapper.start(AdapterWrapper.java:44)
         at 
org.apache.geronimo.corba.TSSBean.registerContainer(TSSBean.java:182)
         at org.apache.geronimo.corba.TSSLink.doStart(TSSLink.java:67)
         at 
org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:998)
...

Caused by: java.lang.IllegalArgumentException: EJB VegetablesCatalogEJB 
does not have a home interface
         at 
org.apache.geronimo.corba.StandardServant.<init>(StandardServant.java:104)
         at 
org.apache.geronimo.corba.StandardServant.<init>(StandardServant.java:91)
         at org.apache.geronimo.corba.Adapter.<init>(Adapter.java:75)

Any idea of what I'm missing? Thanks.

[1] 
https://svn.apache.org/repos/asf/geronimo/server/trunk/testsuite/corba-testsuite/corba-helloworld/
-- 
Jean-Sebastien

Re: Corbaname of an EJB3 session bean

Posted by Juergen Weber <we...@gmail.com>.
Hi, I was looking for a current CSIV2 sample and found this post.
But the samples in geronimo/server/trunk/testsuite/corba-testsuite seem to
be EJB rmi/iiop samples. 
Is there a sample where a corba client connects to an EJB using CSIV2
security? The string CSIV2 is not found below testsuite.

Thanks, Juergen


djencks wrote:
> 
> You have to set up a TSSGBean to configure the csiv2 security for  
> your ejb and add  a TSSLink gbean to associate the ejb with the  
> security config.
> 
> I think there's a fairly complete example in the testsuite.
> 
> hope this helps
> david jencks
> 
> On Mar 27, 2008, at 10:00 AM, Jean-Sebastien Delfino wrote:
> 
>> Given the following EJB3 session bean, deployed to Geronimo v2.1:
>>
>> @Stateless(name="MyCatalogEJB")
>> public class MyCatalogEJBImpl implements CatalogEJB {
>> ...
>> }
>>
>> Having been able to lookup that EJB from a J2SE client as follows:
>>
>> Properties properties = new Properties();
>> properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
>>   "org.apache.openejb.client.RemoteInitialContextFactory");
>> properties.setProperty(Context.PROVIDER_URL,
>>   "ejbd://localhost:4201");
>>
>> InitialContext context = new InitialContext(properties);
>>
>> CatalogEJB catalog = (CatalogEJB)
>>   context.lookup("java:CatalogEJBRemote");
>>
>> I would like to look it up using CosNaming, something like that:
>>
>> InitialContext context = new InitialContext();
>> CatalogEJB catalog = (CatalogEJB)
>>   context.lookup("corbaname:iiop:1.2@localhost: 
>> 1050#CatalogEJBRemote");
>>
>> but whatever name I try I always get the same exception:
>>
>> Exception in thread "main" javax.naming.NameNotFoundException [Root  
>> exception is org.omg.CosNaming.NamingContextPackage.NotFound:  
>> IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
>> 	at com.sun.jndi.cosnaming.ExceptionMapper.mapException 
>> (ExceptionMapper.java:44)
>> 	at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:484)
>> 	at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:523)
>> 	at com.sun.jndi.toolkit.url.GenericURLContext.lookup 
>> (GenericURLContext.java:185)
>> 	at javax.naming.InitialContext.lookup(InitialContext.java:392)
>> 	at client.Client.main(Client.java:24)
>> Caused by: org.omg.CosNaming.NamingContextPackage.NotFound:  
>> IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
>> 	at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read 
>> (NotFoundHelper.java:72)
>> 	at org.omg.CosNaming._NamingContextStub.resolve 
>> (_NamingContextStub.java:251)
>> 	at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:470)
>> 	... 4 more
>>
>>
>> Any idea of what I'm missing? Thanks.
>> -- 
>> Jean-Sebastien
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Corbaname-of-an-EJB3-session-bean-tp16334653s134p25328434.html
Sent from the Apache Geronimo - Dev mailing list archive at Nabble.com.


Re: Corbaname of an EJB3 session bean

Posted by David Jencks <da...@yahoo.com>.
You have to set up a TSSGBean to configure the csiv2 security for  
your ejb and add  a TSSLink gbean to associate the ejb with the  
security config.

I think there's a fairly complete example in the testsuite.

hope this helps
david jencks

On Mar 27, 2008, at 10:00 AM, Jean-Sebastien Delfino wrote:

> Given the following EJB3 session bean, deployed to Geronimo v2.1:
>
> @Stateless(name="MyCatalogEJB")
> public class MyCatalogEJBImpl implements CatalogEJB {
> ...
> }
>
> Having been able to lookup that EJB from a J2SE client as follows:
>
> Properties properties = new Properties();
> properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
>   "org.apache.openejb.client.RemoteInitialContextFactory");
> properties.setProperty(Context.PROVIDER_URL,
>   "ejbd://localhost:4201");
>
> InitialContext context = new InitialContext(properties);
>
> CatalogEJB catalog = (CatalogEJB)
>   context.lookup("java:CatalogEJBRemote");
>
> I would like to look it up using CosNaming, something like that:
>
> InitialContext context = new InitialContext();
> CatalogEJB catalog = (CatalogEJB)
>   context.lookup("corbaname:iiop:1.2@localhost: 
> 1050#CatalogEJBRemote");
>
> but whatever name I try I always get the same exception:
>
> Exception in thread "main" javax.naming.NameNotFoundException [Root  
> exception is org.omg.CosNaming.NamingContextPackage.NotFound:  
> IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
> 	at com.sun.jndi.cosnaming.ExceptionMapper.mapException 
> (ExceptionMapper.java:44)
> 	at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:484)
> 	at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:523)
> 	at com.sun.jndi.toolkit.url.GenericURLContext.lookup 
> (GenericURLContext.java:185)
> 	at javax.naming.InitialContext.lookup(InitialContext.java:392)
> 	at client.Client.main(Client.java:24)
> Caused by: org.omg.CosNaming.NamingContextPackage.NotFound:  
> IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
> 	at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read 
> (NotFoundHelper.java:72)
> 	at org.omg.CosNaming._NamingContextStub.resolve 
> (_NamingContextStub.java:251)
> 	at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:470)
> 	... 4 more
>
>
> Any idea of what I'm missing? Thanks.
> -- 
> Jean-Sebastien