Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Do all remote interfaces have to end in Remote ?

 
Billy Vandory
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
issue: if i rename my remote interface to something other than ending in Remote, JNDI will not find the bean

If the interface ends in Remote, it works. I've tried this with several beans with the same result each time.

TestBean implements TestBeanCar (doesnt work)
TestBean implements TestBeanRemote (works)
OtherBean implements OtherBeanRote (doesnt work)
OtherBean implements OtherBeanRemote (works)

I am annotating the interface with the @Remote annotation and annotating the bean with the @Stateless annotation - using OpenEJB

I found this peculiar.

Thanks folks,

Billy
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Billy,
I think you found a bug in OpenEJB. Oracle's example has a remote interface named "HelloWorld".
 
Billy Vandory
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Billy,
I think you found a bug in OpenEJB. Oracle's example has a remote interface named "HelloWorld".


Really? How do I proceed, do I contact someone? Do I have to get someone to confirm this, like when getting an asteroid or comet named after you?

 
adil qureshi
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Billy Vandory wrote:issue: if i rename my remote interface to something other than ending in Remote, JNDI will not find the bean

If the interface ends in Remote, it works. I've tried this with several beans with the same result each time.

TestBean implements TestBeanCar (doesnt work)
TestBean implements TestBeanRemote (works)
OtherBean implements OtherBeanRote (doesnt work)
OtherBean implements OtherBeanRemote (works)

I am annotating the interface with the @Remote annotation and annotating the bean with the @Stateless annotation - using OpenEJB

I found this peculiar.

Thanks folks,

Billy


Billy it will be nice if you can paste some example code here and what error you are getting because i dont think that this really happens.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Billy Vandory wrote:
Jeanne Boyarsky wrote:Billy,
I think you found a bug in OpenEJB. Oracle's example has a remote interface named "HelloWorld".


Really? How do I proceed, do I contact someone?

Every open source project has their own bug reporting system. I would look for a forum/e-mail/mailing list on the OpenEJB site.
 
David Blevins
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a bug, but I understand how it looks. A couple things in this area make life hard for EJB vendors and then of course for users in return.

This is legal and normal:

RedBean implements ColorRemote
BlueBean implements ColorRemote

In this case what should the JNDI name of each bean be?

As well, beans can have an unlimited number of both @Remote and @Local interfaces:

BrownBean implements CMYKRemote, RGBRemote
OrangeBean implements CMYKRemote, RGBRemote, ColorRemote, ColorLocal

This one is more common with @Local and less common with @Remote.

Really the only unique thing is the ejb-name and even that is only unique within the ejb jar. The only truly unique JNDI name would be something horrendously long like "{application-name}/{module-name}/{ejb-name}/{interface-name}"

We did our best to pick a pragmatic default which is essentially "TheBean" + "@Remote" , but with the "@" yanked, so essentially "TheBeanRemote". Same for @Local views, etc. We will log all JNDI names to the log output and do our best to keep log messages to a minimum so that they won't be missed.

We also, however, understand that what the "right" JNDI name format is is entirely subjective and there is no "one size fits all" answer. So, it is possible to change the default format to whatever you like and still only configure by exception (i.e. you won't have to specify the name of each and every bean to get a format you like). Details here:

http://openejb.apache.org/3.0/jndi-names.html

Hope this helps!

-David
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only truly unique JNDI name would be something horrendously long like "{application-name}/{module-name}/{ejb-name}/{interface-name}"


That's almost how EJB3.1 standardized global JNDI names will look like for EJBs
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic