hi all,
I have deployed my enterprise application on jboss-3.2.2.
It consists of an session bean which is accessed using a Servlet.
The servlet is in a seperate .war file and the ejb's in a .jar file.
However when I call the servlet which inturn calls the session bean.
I get the following error--
javax.naming.NameNotFoundException: ejb not bound
I have double checked my jboss.xml and the servlet lookup().
They both are the same.
The servlet code is-----
public void doGet(HttpServletRequest req,HttpServletResponse res)
throws ServletException,IOException{
try {
/*Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL,"localhost:1099");////chetak:8080/
props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming

rg.jnp.interfaces");
Context ctx = new InitialContext(props);*/
Context ctx = new InitialContext();
Object obj=ctx.lookup("java:comp/env/ejb/beans/SimpleBean");
SimpleHome home = (SimpleHome)PortableRemoteObject.narrow(obj,SimpleHome.class);
} catch (Exception NamingException) {
System.out.println("initexception is"+NamingException);}
try {
res.setContentType("text/html");
PrintWriter out=res.getWriter();
out.println("calling session bean");
Simple test = home.create();
if (test != null)
out.println("<br>Completed creation of remote EJBObject");
else
out.println("<br>Create returned null");
String s = test.getMessage();
out.println("<br>EJB Message: " + s);
out.close();
----------------------------------------------------------------
jboss.xml
<ejb-ref-name>beans/Simple</ejb-ref-name>
<jndi-name>ejb/beans/SimpleBean</jndi-name>
what could be the problem...
I have been trying this since 2 weeks.
please help!