aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Do all remote interfaces have to end in Remote ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Do all remote interfaces have to end in Remote ?" Watch "Do all remote interfaces have to end in Remote ?" New topic
Author

Do all remote interfaces have to end in Remote ?

Billy Vandory
Ranch Hand

Joined: Mar 23, 2010
Posts: 57
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

Joined: May 26, 2003
Posts: 30758
    
156

Billy,
I think you found a bug in OpenEJB. Oracle's example has a remote interface named "HelloWorld".


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Billy Vandory
Ranch Hand

Joined: Mar 23, 2010
Posts: 57
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

Joined: Jul 11, 2008
Posts: 48
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.


SCJP 1.5,SCWCD 1.5
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30758
    
156

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

Joined: May 03, 2010
Posts: 18
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

Joined: Jul 20, 2005
Posts: 10202
    
166

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

[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Do all remote interfaces have to end in Remote ?