I have a WAR that exposes some beans over to JNDI. I then have a Stateless SB that returns an interface to the Spring bean.
The Spring bean is :
ProductManagerImpl which implements IProductManager
The
EJB is :
@javax.ejb.Stateless(name = "ProductManagerEJB")
@Local(ProductManagerLocal.class)
@Remote(ProductManagerRemote.class)
public class ProductManagerBean implements ProductManagerLocal, ProductManagerRemote {
public IProductManager getProductManager() {
IProductManager productManager=null;
try {
InitialContext context = new InitialContext();
productManager = (IProductManager) context.lookup("ProductManager"); //This is bound using Spring
} catch (NamingException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
return productManager;
}
}
When lookup the bean on JNDI, I get a ClassNotFoundException for ProductManagerBeanImpl (the actual implementation). Is this needed at the client side? I'm trying to not have too much that is needed at the client side. The
Jboss documentation is all very confusing to me.
InitialContext initialContext = new InitialContext();
ProductManagerRemote productManagerRemote = (ProductManagerRemote) initialContext.lookup(G_EJB_BRIDGE_PRODUCT_MANAGER_EJB_REMOTE);
System.out.println(productManagerRemote.getProductManager().getName());
-Avi