4 Replies Latest reply: Dec 3, 2012 9:30 AM by Laura delli Paoli RSS

    jbpm No persistence provider for EntityManager named org.drools.task

    RSTVMA LDHYAGF Newbie

      hello,

       

      jbpm No persistence provider for EntityManager named org.drools.task

       

      I'm new in jbpm i was  trying my first project jst to be fimiliar with the platform. I have this code in my main class:

       

              KnowledgeBase kBase= reaKnowledgeBase();

             

              EntityManagerFactory emf=Persistence.createEntityManagerFactory("org.drools.task");

              Environment env=KnowledgeBaseFactory.newEnvironment();

              env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);

       

      but when i try to run the class i got this error. I realy need help

       

          javax.persistence.PersistenceException: No Persistence provider for EntityManager named org.drools.task

          at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:56)

          at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)

          at example.ExapmleMainClass.main(ExapmleMainClass.java:50)

        • 1. Re: jbpm No persistence provider for EntityManager named org.drools.task
          Mauricio Salatino Master

          The error is quite clear,

          do you have a persistence.xml file defining a Persistence Unit called "org.drools.task" inside your project?

          Cheers

          • 2. Re: jbpm No persistence provider for EntityManager named org.drools.task
            RSTVMA LDHYAGF Newbie

            hey Mauricio Salatino,

             

            I do have persistence.xml like this:

             

            <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

             

            - <persistence version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/persistence">

             

             

            <persistence-unit name="org.drools.task">

             

             

            <provider>org.hibernate.ejb.HibernatePersistence</provider>

             

             

            <class>org.jbpm.task.Attachment</class>

             

             

            <class>org.jbpm.task.Content</class>

             

             

            <class>org.jbpm.task.BooleanExpression</class>

             

             

            <class>org.jbpm.task.Comment</class>

             

             

            <class>org.jbpm.task.Deadline</class>

             

             

            <class>org.jbpm.task.Comment</class>

             

             

            <class>org.jbpm.task.Deadline</class>

             

             

            <class>org.jbpm.task.Delegation</class>

             

             

            <class>org.jbpm.task.Escalation</class>

             

             

            <class>org.jbpm.task.Group</class>

             

             

            <class>org.jbpm.task.I18NText</class>

             

             

            <class>org.jbpm.task.Notification</class>

             

             

            <class>org.jbpm.task.EmailNotification</class>

             

             

            <class>org.jbpm.task.EmailNotificationHeader</class>

             

             

            <class>org.jbpm.task.PeopleAssignments</class>

             

             

            <class>org.jbpm.task.Reassignment</class>

             

             

            <class>org.jbpm.task.Status</class>

             

             

            <class>org.jbpm.task.Task</class>

             

             

            <class>org.jbpm.task.TaskData</class>

             

             

            <class>org.jbpm.task.SubTasksStrategy</class>

             

             

            <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>

             

             

            <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>

             

             

            <class>org.jbpm.task.User</class>

             

             

            - <properties>

             

             

            <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />

             

             

            <property name="hibernate.connection.driver_class" value="org.h2.Driver" />

             

             

            <property name="hibernate.connection.url" value="jdbc:h2:mem:mydb" />

             

             

            <property name="hibernate.connection.username" value="sa" />

             

             

            <property name="hibernate.connection.password" value="sasa" />

             

             

            <property name="hibernate.connection.autocommit" value="false" />

             

             

            <property name="hibernate.max_fetch_depth" value="3" />

             

             

            <property name="hibernate.hbm2ddl.auto" value="create" />

             

             

            <property name="hibernate.show_sql" value="true" />

             

            </properties>

            </persistence-unit>

            </persistence>

             

            but still when i run it now i got errors like this

             

            028/06 16:08:25,500[main] ERROR ejb.packaging.PersistenceXmlLoader.fatalError  - Error parsing XML: XML InputStream(2) The processing instruction target matching "[xX][mM][lL]" is not allowed.

            javax.persistence.PersistenceException: Unable to configure EntityManagerFactory


            at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:265)

            at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)

            at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)

            at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)

            at example.ExapmleMainClass.main(ExapmleMainClass.java:51)

            Caused by: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.


            at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)

            at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)

            at org.hibernate.ejb.packaging.PersistenceXmlLoader.loadURL(PersistenceXmlLoader.java:70)

            at org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(PersistenceXmlLoader.java:89)

            at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:222)

            ... 4 more
            • 3. Re: jbpm No persistence provider for EntityManager named org.drools.task
              loaone seleka Newbie

              Hello

               

              I have the persistence.xml file that has org.jbpm.task but i still

              get the same error please help

               

              thanx