2

I have an RCP application i made with eclipse indigo 3.7.2 and i want to communicate with a Derby database using eclipselink. But i cant make it to work. My problem is with eclipselink, i tried including the jars and also tried with the bundles.By including jars i get i get

java.lang.NoClassDefFoundError: javax/persistence/Persistence

By including bundles from product, it can not find import javax.persistence and in product`s depedency tab i see the plugin with version (0.0.0) for example org.eclipse.persistence.jpa(0.0.0)

my persistance.xml is in META-INF folder and is :

* http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">

    <class>org.encryption.steganography.model.User</class>

    <properties>
        <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.EmbeddedDriver" />
            <property name="javax.persistence.jdbc.url"
            value="jdbc:derby:C:\Users\Paner\Desktop\Steganography\relationsshipDb;create=true" />
        <property name="javax.persistence.jdbc.user" value="test" />
        <property name="javax.persistence.jdbc.password" value="test" />
        <!-- EclipseLink should create the database schema automatically -->
        <property name="eclipselink.ddl-generation" value="create-tables" />
        <property name="eclipselink.ddl-generation.output-mode"
            value="database" />
    </properties>
</persistence-unit>

*

any suggestions?

ddarellis
  • 3,912
  • 3
  • 25
  • 53

1 Answers1

1

Do you have the JPA javax.persistence.jar or persistence.jar on your classpath?

James
  • 17,965
  • 11
  • 91
  • 146
  • this fixed the problem but now i face another javax.persistence.PersistenceException: No Persistence provider for EntityManager named, i think that my persistence.xml cant be found from application, i have it src/META-INF/persistence.xml and i use org.eclipse.persistence.jpa.PersistenceProvider – ddarellis Apr 17 '12 at 07:28