[jboss-user] [EJB 3.0 Users] - Session Bean with Multiple Interfaces and @LocalBinding
keigwin
do-not-reply at jboss.com
Fri Sep 18 13:41:44 EDT 2009
I'm using JBoss 5.1 and have an EJB 2.1 application that I'm migrating to EJB 3.0. In this application, there are stateless session beans that expose two different interfaces. For example, there is a bean called UserServiceBean which has a local interface called UserServiceLocal and another local interface called UserAdminLocal. UserServiceLocal exposes the methods needed by the main application, while UserAdminLocal extends UserServiceLocal to provide those same methods plus some new ones to our administrative application.
As part of the migration from 2.1 to 3.0, I am using the @LocalBinding annotation to ensure that the JNDI names of the migrated and un-migrated session beans stays consistent.
Now I've run into a problem. It appears I can't use @LocalBinding to bind the same session bean to JNDI twice (once for each interface). When I try to do this, I get the following error from JBoss at startup:
Deployment "vfszip:/C:/Program%20Files/jboss-5.1.0.GA/server/web/deploy/SellCoreComponentEAR.ear/" is in error due to the following reason(s): java.lang.AssertionError: Currently only 1 @LocalBinding is supported for EJB UserServiceBean
I've also tried pushing the methods for the Admin interface down into a subclass so that I could provide a different @LocalBinding there, but I get the same result.
Can anyone suggest a way to solve this other than by creating two bean classes, one of which is a delegate to the other?
Thanks in advance,
Kevin
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4255974#4255974
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4255974
More information about the jboss-user
mailing list