tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert van Loenhout <r.vanloenh...@greenvalley.nl>
Subject RE: ejb2 jndi name
Date Wed, 31 Aug 2016 13:32:31 GMT
I debugged JndiBuilder in openejb-core and find out my object is binded as _RemoteHome.
I can access it if I use the "org.apache.openejb.client.LocalInitialContextFactory" as a property
for the initial context.

I wanted to ask if these are my only two options.
1) Use a long global name, that even includes versions strings, to get your object
2) Use a convention local name, but initialize the initial context that includes a dependency
to openejb

If the global jndi didn't include those version strings I would already have been content.


-----Original Message-----
From: Robert van Loenhout [mailto:r.vanloenhout@greenvalley.nl] 
Sent: 30 August 2016 17:38
To: users@tomee.apache.org
Subject: RE: ejb2 jndi name

It's the description of the interfaceType.annotationName I found confusing. I feel like I'm
missing some interpunctuation.
LocalHome follows the @LocalHome EJB 3 annotation, but is also for EJB 2 EJBLocalHome?
And after that it mentions EJB 3 in parentheses even though it already mentioned it follows
EJB 3 annotations. 
But it probably just has to do with my unfamiliarity with EJB in general.

I already used the LocalInitialContextFactory to create the InitialContext.



-----Original Message-----
From: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
Sent: 30 August 2016 17:08
To: users@tomee.apache.org
Subject: Re: ejb2 jndi name

2016-08-30 17:03 GMT+02:00 Robert van Loenhout <r.vanloenhout@greenvalley.nl
>:

> I thought http://tomee.apache.org/jndi-names.html seems to suggest the 
> names are different for EJB 2.
>
>
Not sure what's misleading there, can you be more precise? the left column in the table is
the placeholder you can use and the right explains the value which differentiate the values
for EJB 2 and 3 of type name for instance.


> For simplicity I tried to set
> openejb.jndiname.format = {ejbClass}
> and
> openejb.jndiname.format = {ejbName}
>
> but still cannot find it.
> So no java: or openejb: in front of it, right?
>
>
Can be needed for the default initial context, if you have issue cause you are in a not managed
thread you can need to set the LocalInitialContextFactory when doing the lookup, see http://tomee.apache.org/clients.html



>
>
> -----Original Message-----
> From: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> Sent: 30 August 2016 16:44
> To: users@tomee.apache.org
> Subject: Re: ejb2 jndi name
>
> your deployment id is MyEjb and annotation name is LocalHome so 
> MyEjbLocalHome
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog < 
> https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog < 
> http://rmannibucau.wordpress.com> | Github 
> <https://github.com/rmannibucau>
> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber <
> http://www.tomitribe.com> | JavaEE Factory <https://javaeefactory- 
> rmannibucau.rhcloud.com>
>
> 2016-08-30 16:41 GMT+02:00 Robert van Loenhout < 
> r.vanloenhout@greenvalley.nl
> >:
>
> > Hi Romain,
> >
> > Do I need a prefix?
> > By default it would be
> > Context.lookup("MyEjbEJBHome") ?
> >
> >
> > -----Original Message-----
> > From: Romain Manni-Bucau [mailto:rmannibucau@gmail.com]
> > Sent: 30 August 2016 16:19
> > To: users@tomee.apache.org
> > Subject: Re: ejb2 jndi name
> >
> > Hi Robert,
> >
> > first of all legacy names are not logged but still active so 
> > normally you don't need to configure it. Default is:
> > {deploymentId}{interfaceType.annotationName}
> >
> > Then system.properties is a good place to configure any tomee 
> > property (it should be the default location as an user actually).
> >
> > If you need more assistance I would suggest you to build a project 
> > with an arquillian test using arquillian-tomee-remote to reproduce 
> > your issue and share the link to github (or any public repository) 
> > to let us help you in an accurate way. Arquillian will allow you to 
> > configure the system properties in arquillian.xml (see properties of 
> > tomee remote adapter on 
> > http://tomee.apache.org/ng/developer/testing/arquillian/index.html )
> >
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog < 
> > https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog < 
> > http://rmannibucau.wordpress.com> | Github 
> > <https://github.com/rmannibucau>
> > | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber <
> > http://www.tomitribe.com> | JavaEE Factory <https://javaeefactory- 
> > rmannibucau.rhcloud.com>
> >
> > 2016-08-30 16:08 GMT+02:00 Robert van Loenhout < 
> > r.vanloenhout@greenvalley.nl
> > >:
> >
> > > Hi,
> > >
> > > I'm deploying something with ejb2 in tomee.
> > > In the log I can see entries like thisd that bind the EJBs to JNDI.
> > > Jndi(name=global/my_ear-version/my_ejb-version/MyEjb!com.company.M
> > > yE
> > > jb
> > > Home)
> > > --> Ejb(deployment-id=MyEjb)
> > > Jndi(name=global/my_ear-version/my_ejb-version/MyEjb) -->
> > > Ejb(deployment-id=MyEjb)
> > >
> > > I can indeed use these global names to access my EJB from the 
> > > InitialContext, however I need a way to access them with an easier 
> > > name, prefereably the ejb-name, or the deployment-id.
> > >
> > > I tried to search an answer for this and I did get the following 
> > > information.
> > >
> > > http://tomee.apache.org/deployment-id.html
> > > This page mentions that I, a lazy developer, can use the -D option 
> > > of the deploy tool, but I don't know how to configure this for tomee.
> > >
> > > http://tomee.apache.org/jndi-names.html
> > > This page specifies how to customize the JNDI name.
> > > I have set
> > > openejb.jndiname.format = {ejbName} in the system.properties and 
> > > catalina.properties, but it doesn't seem to have any effect.
> > >
> > > Thanks for any help.
> > >
> > >
> > >
> >
>
Mime
View raw message