I am using EJB3.0, Weblogic 11g
I am trying to do simple lookup from servlet to Statelessbean and run there a method. both under the same EAR. I managed to do it with Jboss. but I know that in Weblogic it's little bit diffrent so I channged my code and this is what I am doing and still no success:
The interface I have declared:
@Local
public interface OperatorBlockBeanLocal
{
public void testme();
}
This is the class which implements the Interface:
@Stateless
@Local{ OperatorBlockBeanLocal.class })
@JNDIName(value = "OperatorBlockBean")
public class OperatorBlockBean implements OperatorBlockBeanLocal
{
public void testme()
{
System.out.println("OperatorBlockBean");
}
}
And this is the servlet which trying to lookup the bean I decalred before:
try
{
context = new InitialContext();
operatorBlockBean = (OperatorBlockBeanLocal) context
.lookup("java:comp/env/OperatorBlockBean");
operatorBlockBean.testme();
} catch (NamingException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
Ofcourse that I get NamingException. anyone has any idea?
thanks, ray.