Announcement Announcement Module
No announcement yet.
probleme with provider DATANUCLEUS Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • probleme with provider DATANUCLEUS

    hello every body;
    i create a spring ROO(1.2 release) project with STS i use this list of command :

    jpa setup --provider DATANUCLEUS --database HYPERSONIC_IN_MEMORY
    entity jpa --class ~.Employee
    field string --fieldName name
    web mvc setup
    web mvc all --package ~.web

    when i start it to the server i have this error :
    2012-02-28 11:29:47,259 [Thread-10] ERROR DataNucleus.Persistence - Error : An error occurred trying to instantiate an instance of the API adapter "org.datanucleus.api.jpa.JPAAdapter" (perhaps you dont have the requisite datanucleus-api-XXX jar in the CLASSPATH, or the api jar for the persistence spec you are using?) : {1}

    all the dependency already existing in my CLASSPATH
    so can some one help me please !!!

  • #2
    I just published an article to TheServerSide that discusses how to set up and configure your development environment to use DataNucleus as the Java Persistence API (JPA) provider. I've linked to this thread from the article, hoping anyone who is having trouble running the example might post their question here and take advantage of the big brains that make up the JavaRanch community.

    Anyways, the darnedest thing about putting together the tutorial was that during the writing, I kept getting this annoying error that said:

    Exception in thread "main" javax.persistence.PersistenceException:
    No persistence providers available for "PU" after trying the following discovered implementations:
    at javax.persistence.Persistence.createEntityManagerF actory(
    at javax.persistence.Persistence.createEntityManagerF actory

    Anyways, I saw a few posts on the issue, but no solutions. I knew it had to be a simple mistake, and sure enough, it was. I had the incorrect entry in my persistence.xml file:
    view plaincopy to clipboardprint?
    <!-- INCORRECT -->
    <provider>org.datanucleus.jpa.EntityManagerFactory Impl</provider>

    The correct entry for this application should have been:
    view plaincopy to clipboardprint?
    <provider>org.datanucleus.jpa.PersistenceProviderI mpl</provider>

    The full persistence.xml file looked like this:

    view plaincopy to clipboardprint?

    <?xml version="1.0" encoding="UTF-8" ?>
    <persistence xmlns="" version="1.0">
    <persistence-unit name="PU">
    <provider>org.datanucleus.jpa.PersistenceProviderI mpl</provider>
    <exclude-unlisted-classes />
    <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/rps" />
    <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
    <property name="javax.persistence.jdbc.user" value="root" />
    <property name="javax.persistence.jdbc.password" value="password" />

    Anyways, that fixed it, just in case anyone is having a similar issue.
    Last edited by hasselcloud; Mar 5th, 2012, 02:53 PM.


    • #3
      in the CLASSPATH i have "datanucleus-api-jpa-3.0.6.jar" and the class provider "org.datanucleus.api.jpa.PersistenceProviderIm pl" has already exist so i don't know were is the problem , so can some one help me please ?


      • #4
        i use datanucleus V2 to resolve this error but now i have a new bug :
        ERROR DataNucleus.MetaData - Found Meta-Data for class com.ex.Employee but this class is not enhanced!! Please enhance the class before running DataNucleus.
        org.datanucleus.exceptions.NucleusUserException: Found Meta-Data for class com.ex.Employee but this class is not enhanced!! Please enhance the class before running DataNucleus.