This content has been marked as final.
Show 5 replies
-
1. Re: Third-party EJBs as seam components
pmuir Aug 2, 2007 5:48 AM (in response to patrickr)As long as Seam can look up the bean in jndi then it should be fine. so use jndiName.
-
2. Re: Third-party EJBs as seam components
pmuir Aug 2, 2007 5:49 AM (in response to patrickr)The manager pattern you mention should work as well.
-
3. Re: Third-party EJBs as seam components
patrickr Aug 6, 2007 1:36 PM (in response to patrickr)Thanks for your answers, Pete! And sorry for responding so late. However, I can't get the jndi-name lookup working. Since I didn't find any information in the docs, could you please tell me what exactly jndi-name expects?
I supposed that this would work.<core:init jndi-pattern="wct-example/#{ejbName}/local" debug="true"/> <component name="shoppingCart" jndi-name="wct-example/ShoppingCartBean/local" scope="session" auto-create="true" />
But when I use this for injection, shoppingCart is always null.
Also, while I see19:22:35,199 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=wct-example.ear,jar=wct-commerce.jar,name=ShoppingCartBean,service=EJB3 with dependencies: 19:22:35,199 INFO [JmxKernelAbstraction] jboss.j2ee:ear=wct-example.ear,jar=wct-commerce.jar,name=OrderManagerBean,service=EJB3 19:22:35,349 INFO [EJBContainer] STARTED EJB: de.wct.commerce.service.ShoppingCartBean ejbName: ShoppingCartBean
...I don't see a seam component log message for shoppingCart. -
4. Re: Third-party EJBs as seam components
patrickr Aug 6, 2007 1:51 PM (in response to patrickr)Doing it programmatically works:
@Name("shoppingCart") @Scope(ScopeType.SESSION) public class ShoppingCartManager { private ShoppingCart shoppingCart; @Create public void create() throws NamingException { InitialContext ic = new InitialContext(); //shoppingCart = (ShoppingCart) ic.lookup(ShoppingCart.class.getName()); shoppingCart = (ShoppingCart) ic.lookup("wct-example/ShoppingCartBean/local"); } @Unwrap public ShoppingCart getShoppingCart() { return shoppingCart; } }
But why not with the components.xml? Is this a bug? -
5. Re: Third-party EJBs as seam components
pmuir Aug 7, 2007 8:52 AM (in response to patrickr)You need to specify the class as well.