facebook

Cannot enable JPA

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #301768 Reply

    crispyoz
    Member

    I’ve been using JPA with myeclipse 7.5 for some time now and for whatever reason my project got messed up so blew away the project directory, created a new project and added my existing code and pages.

    Each time I run I get an error:

    java.lang.ClassNotFoundException: javax.persistence.Persistence
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
    java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

    Which doesn’t make any sense because I am using J2EE 5 so the class should be included.

    Anyway when I try to add use Add Capabilities JPA is greyed out. I also can’t seem to find where I define the persistence unit, I guess that would be my first starting point.

    Thanks for any advice.

    Chris

    #301776 Reply

    support-joy
    Member

    Chris,

    where I define the persistence unit

    Do you mean to say the Persistence provider. If yes, the persistence provider is available at the time of adding JPA capabilities to the project.

    Can you try creating new project and add the JPA capabilities to the project first and add your files to the project?

    If the problem still persists, switch to a new workspace.

    #301793 Reply

    crispyoz
    Member

    Thanks Joy,

    That worked. Why can’t I add it to the existing project though?

    Chris

    #301816 Reply

    support-joy
    Member

    Chris,

    Good to hear you are set. 🙂

    Why can’t I add it to the existing project though?

    There are couple of reasons. Some are
    1) If you want to add the capabilities, the existing code has to be rewritten accordingly.
    2) The class files which are already created doesn’t have the capabilities.
    The above mentioned are the reasons for your case, but we can add the capabilities in many cases.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Cannot enable JPA

This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.

You must be logged in to post in the forum log in