[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openejb-user
Subject:    Re: JNDI in OpenEJB
From:       "benjamin.renaud" <nabble () benjaminrenaud ! otherinbox ! com>
Date:       2008-12-10 17:38:30
Message-ID: 20940170.post () talk ! nabble ! com
[Download RAW message or body]


I have solved a piece of the puzzle by building my initial context like so:

Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory");
context = new InitialContext(properties);

However, I'd still like to know how to get mappedName to work, if possible.

Thanks!
Benjamin


benjamin.renaud wrote:
> 
> Hi all,
> 
> I'm trying to port an app from Glassfish to Tomcat+OpenEJB. Right now the
> main issue I am hitting is how OpenEJB deals with JNDI (vs GF)
> 
> I have a host of Stateless EJBs, for which I used to specify the name
> using the mappedName attribute in the @Stateless annotation:
> @Stateless(mappedName = "myApp/myEjbName")
> 
> OpenEJB loads all my EJBs. This is the output of the log:
> 
> 2008-12-10 07:17:29,772 - INFO  - Created
> Ejb(deployment-id=DomainManagerBean, ejb-name=DomainManagerBean,
> container=My Stateless Container)
> 2008-12-10 07:17:29,772 - INFO  - Created
> Ejb(deployment-id=TypeManagerBean, ejb-name=TypeManagerBean, container=My
> Stateless Container)
> 2008-12-10 07:17:29,772 - INFO  - Created
> Ejb(deployment-id=UserManagerBean, ejb-name=UserManagerBean, container=My
> Stateless Container)
> 
> etc.
> 
> When I look at the deployed JNDI names using the OpenEJB console, they
> match what the -OpenEJB documentation- (as opposed to what mappedName)
> says should be their name: DomainManagerBeanRemote, TypeManagerBeanRemote,
> UserManagerBeanRemote. And they work - I can invoke them using the handy
> invoker from the console.
> 
> I have a few questions:
> 
> 1. If a POJO (not a bean) in my web app does a JNDI lookup, what does it
> see? Specifically, I use a pattern where I have a POJO do all the lookup
> for my beans on behalf other POJOs. Right now they don't seem to see
> either the mappedName, nor the deploymentID-based name.
> http://openejb.apache.org/deployment-id.html makes a distinction between
> 'bean' and 'non-bean'. I would have interpreted that to mean that POJOs
> (non-beans) get access to the Global JNDI namespace.
>  
> 2. is the mappedName attribute supported in OpenEJB? The doc for 3.0 seems
> to indicate it does, but my experiment here seems to indicate the
> opposite. Anyone knows if I am doing something wrong?
> 
> Thanks much!
> Benjamin
> 
-- 
View this message in context: http://www.nabble.com/JNDI-in-OpenEJB-tp20937758p20940170.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic