[jboss-user] [EJB 3.0] - Re: Simplest possible stateless bean

wolfc do-not-reply at jboss.com
Wed Sep 19 11:25:06 EDT 2007


"Renen" wrote : I must say, this is a bit frustrating. I don't understand why I need to generate an interface class. It doesn't seem to add any value to what I am doing, and the interface and the actual bean will always correspond 100%. Silly. I presume that there is an xdoclet type solution that will generate it for me. But I must say, I had hoped to be moving away from that overhead.
How would you like to reference your bean from a client (or servlet)? Maybe there is an alternative that's missing.
"Renen" wrote : Then, including the ear name in the default JNDI name doesn't make sense. What happens if you need to use the classes in multiple ears?
The name for the bean must be as unique as possible in JNDI, or else you wouldn't be able to deploy the same bean in another enterprise application.

For example, you could run multiple shops on the same system and thus only have one coded ShoppingCartBean. This EJB is then included into each EAR which wants shopping cart functionality.
"Renen" wrote : ...
  | However, I have no idea in which package I can find org.jboss.annotation.ejb.LocalBinding. I would  be obliged if you could let me know. Perhaps somebody could add that nugget to the tutorial as well.
jboss-annotations-ejb3.jar
"Renen" wrote : Interestingly, there are a couple of posts that suggest that you can do the T2Bean.class.getName()) thing. For example: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=66845 (see the last post). To my mind, this is much more elegant. That said, I mostly just want a solution... ;-~
Again a JNDI name needs to be unique. And what if you had multiple bussiness interfaces, should we 'polute' JNDI by binding them all?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4086193#4086193

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4086193



More information about the jboss-user mailing list