facebook

JPA, Plugins, RCP

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #320280 Reply

    ericrivera
    Participant

    Hi,

    I am developing an RCP application that contains multiple plugins. One plugin is JPA capable in order to manage CRUD operations. If I test the code in this plugin with a class with a main in it it works fine. The entities get loaded with the data from the database using the DAOs and the EntityManagerHelper generated by MyEclipse 9.1.

    When I run the application as a plugin the following exception is thrown:

    java.lang.ClassNotFoundException: javax.persistence.Persistence
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    at edu.unmc.cns.condb.model.EntityManagerHelper.<clinit>(EntityManagerHelper.java:20)
    at edu.unmc.cns.condb.model.jpa.db.dao.AccountCategoryDAO.findAll(AccountCategoryDAO.java:228)

    Work with the test class in the JPA plugin running as a Java Application but not when ran as an Eclipse application.

    What I am doing wrong?

    Thanks,

    eric

    #320290 Reply

    Brian Fernandes
    Moderator

    Eric,

    When you run your application as a standalone Java application, simple dependencies to JAR files (or other projects) are just fine, these modifications go to your .classpath file.

    When you run as a plugin, however, you need to modify your plugin’s MANIFEST.MF to include these libraries as well as dependencies on other plugins. I’m not sure if you’ve done this; you can add dependencies from the plugin.xml editor.

    Hope this helps.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: JPA, Plugins, RCP

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