Results 1 to 2 of 2
  1. #1
    tascoa is offline Member
    Join Date
    Oct 2008
    Posts
    16
    Rep Power
    0

    Default Name persistence is not bound in this Context

    Hello, I have a problem with implementation WebApplication with JPA.

    Servlet is in the attachment...

    Exception is:

    java.lang.RuntimeException: javax.naming.NameNotFoundException: Name persistence is not bound in this Context
    web.EplDetails.findByID(EplDetails.java:126)
    web.EplDetails.processRequest(EplDetails.java:58)
    web.EplDetails.doGet(EplDetails.java:84)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:627)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:729)

    Can anybody help me with it???

    Thanks.
    Attached Files Attached Files

  2. #2
    FON
    FON is offline Senior Member
    Join Date
    Dec 2009
    Location
    Belgrade, Serbia
    Posts
    364
    Rep Power
    5

    Default

    I don't use approach with JNDI and Context
    but if you use Eclipse i can post a simple manual
    how to create entities from tables,
    get persistence.xml file with tag:
    <persistence-unit name="JPA1">

    and then just simply call it from your code:

    ....
    EntityManagerFactory emf = Persistence.createEntityManagerFactor("JPA1");

    EntityManager em = emf.createEntityManager();
    ...

    regards

Similar Threads

  1. Array Index Out of bound exception
    By abhijit in forum Networking
    Replies: 7
    Last Post: 09-25-2009, 07:25 PM
  2. javax.naming.NameNotFoundException: bean not bound
    By Sirisha_24 in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 04-01-2009, 10:51 AM
  3. [SOLVED] String out of bound error
    By maxb in forum New To Java
    Replies: 4
    Last Post: 12-01-2008, 02:32 PM
  4. ArrayIndexout of Bound exception
    By Preethi in forum New To Java
    Replies: 2
    Last Post: 02-14-2008, 09:40 PM

Posting Permissions

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