Hi!
I'm beggining in development with JBoss and don't have success to deploy a simple session bean.
The following message warning is displayed in the log:
2004-05-23 23:51:03,562 WARN [org.jboss.web.tomcat.tc4.EmbeddedTomcatService] Unable to invoke setDelegate on class loader:org.jboss.web.tomcat.tc4.WebCtxLoader$ENCLoader@929ba3
ejb-ar.xml:
...
<ejb-name>ejb/HelloBean</ejb-name>
hello.HelloBeanHome
hello.HelloBean
<ejb-class>hello.ejb.HelloBeanClass</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
...
servlet that access the bean:
...
public class HelloServlet extends HttpServlet
{
public void doGet (HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException
{
HelloBean hello = getEJB ();
res.setContentType ("text/html");
PrintWriter pw = new PrintWriter (res.getOutputStream());
pw.println ("");
pw.println ("");
pw.println ("<H1>Test Servlet</H1>");
pw.println ("" + hello.sayHello ());
pw.println ("");
pw.println ("");
pw.flush ();
pw.close ();
}
private HelloBean getEJB () throws ServletException {
try {
InitialContext ctx = new InitialContext ();
Object ref = ctx.lookup ("HelloBean");
HelloBeanHome home = (HelloBeanHome)PortableRemoteObject.narrow (ref, HelloBeanHome.class);
return home.create ();
}
catch (Exception e) {
throw new ServletException (e);
}
}
}
...
The message displayed when the servlet is executed:
...
javax.naming.NameNotFoundException: HelloBean not bound
...
In the JMX MBean View -> List the bean was not visible, nor in jboss.j2ee of the JMX Agent View.
I think that the warning when I deploy the war file is the root of problem. How I can fix this problem? What's wrong?
Thanks in advance.
moratelli
moratell@terra.com.br