[jboss-user] [EJB 3.0] - locate services with service locator?

luckybird do-not-reply at jboss.com
Fri Dec 12 04:27:36 EST 2008


Hi all,
I have some servlets (lets say, ServA and ServB) on my JBoss 4.2.2.GA. Now I want to use the ServB from ServA. Both Servlets are registered in JNDI. The only way that works is a JNDI lookup in ServA to ServB. Injection via @Resource doesn't work. The old ServiceLocator pattern doesn't work, too (because no EJBHome exists). 

Is there a convenient method to write a generic service locator class which locates a given service and returns the correct service interface? One way I've tried is the ServiceLocator package from ALR, but this package is in a raw state and I didn't know how to use it (which configuration is needed). Any suggestions are welcome. The topics in this forum refer mostly to JSF or such things, which I don't need.

TIA,
Ralf.

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

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



More information about the jboss-user mailing list