Results 1 to 3 of 3
  1. #1
    Sirisha_24 is offline Member
    Join Date
    Jan 2009
    Posts
    1
    Rep Power
    0

    Default javax.naming.NameNotFoundException: bean not bound

    I am trying to build an EE project that has a EJB module and a web module. I am using servlet as my client to call EJB. here is my code:
    public class WebClient extends HttpServlet
    {

    private Context ctx;
    @EJB
    HelloWorld bean ;
    public void doGet(HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException
    {
    response.setContentType("text/html;charset=ISO-8859-1");
    PrintWriter out = response.getWriter();



    try {

    if (bean != null)
    {
    bean.setName("Roman");
    out.println("<html><body>");
    out.println("This is a simple EJB-Bean-Test: ");
    out.println(bean.getGreeting());
    out.println("</body></html>");
    }
    else
    {
    out.println("<html><body>");
    out.println("Lookup for bean failed!");
    out.println("</body></html>");
    }
    }catch (Exception e) {
    System.out.println("exception"+e);
    e.printStackTrace();
    }
    }
    }

    Please tell me what is going wrong?I have been spending close to a week on this. :(

    Thanks,
    Sirisha

  2. #2
    peppem is offline Member
    Join Date
    Jan 2009
    Location
    italy
    Posts
    16
    Rep Power
    0

    Default

    When you write

    @EJB
    HelloWorld bean ;

    HelloWorld is the bean implementation or interface?
    If It is interface, what type of (Local or Remote)?
    Article and examples about Java EE world
    http://programmaremobile.blogspot.com

  3. #3
    sarath is offline Member
    Join Date
    Apr 2009
    Posts
    3
    Rep Power
    0

Similar Threads

  1. Replies: 2
    Last Post: 08-07-2009, 11:21 PM
  2. javax.microedition.io/ javax.bluetooth
    By ahtiven in forum New To Java
    Replies: 3
    Last Post: 01-13-2009, 03:54 PM
  3. [SOLVED] String out of bound error
    By maxb in forum New To Java
    Replies: 4
    Last Post: 12-01-2008, 03:32 PM
  4. ArrayIndexout of Bound exception
    By Preethi in forum New To Java
    Replies: 2
    Last Post: 02-14-2008, 10:40 PM
  5. javax.naming.NameNotFoundException: ejb/RatingEJB
    By Daniel in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 06-29-2007, 03:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •