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
ericrivera
Post subject: JPA, Plugins, RCP  PostPosted: Oct 06, 2011 - 06:53 PM
Registered Member
Registered Member


Joined: Sep 30, 2011
Posts: 4

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
 
 View user's profile Send private message  
Reply with quote Back to top
Support-Brian
Post subject:   PostPosted: Oct 07, 2011 - 06:59 AM
Moderator
Moderator


Joined: Aug 21, 2004
Posts: 2583

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.

_________________
Brian
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
Credits