MyEclipse Forums
This thread has been locked & this forum has been archived.
Please post new topics to Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Post subject: JPA, Plugins, RCP  PostPosted: Oct 06, 2011 - 06:53 PM
Registered Member
Registered Member

Joined: Sep 30, 2011
Posts: 4


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(
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(
at edu.unmc.cns.condb.model.EntityManagerHelper.<clinit>(
at edu.unmc.cns.condb.model.jpa.db.dao.AccountCategoryDAO.findAll(

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?


 View user's profile Send private message  
Reply with quote Back to top
Post subject:   PostPosted: Oct 07, 2011 - 06:59 AM

Joined: Aug 21, 2004
Posts: 2583


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.

MyEclipse Support
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group