TaskImpl not mapped in HR example

364 views
Skip to first unread message

Murthy Gandikota

unread,
Feb 26, 2015, 3:54:10 PM2/26/15
to jbpm-...@googlegroups.com

Hi All

 

While reading http://docs.jboss.org/jbpm/v6.1/userguide/jBPMExamples.html

I found a github url to download examples into Eclipse.  

I then built the human-resources and human-resources-tests. I ran into two issues while testing:

a)      (a)In EnvironmentProducer the method getFactory(BeanManager, AbstractAuditLogger) is ambiguous for the type InjectableRegisterableItemsFactory

b)      (b)When I run the tests, I get the exception TaskImpl is not mapped

To handle (a) I simply commented out the code. Hope it is not a serious flaw in my testing. I however don’t know how to proceed on (b). Should I create a Task Implementation class or how does that work?

Your kind comments are appreciated

Thanks

murthy 

Mauricio Salatino

unread,
Feb 26, 2015, 4:13:51 PM2/26/15
to Murthy Gandikota, jbpm-...@googlegroups.com
Do you have a persistence.xml file in the project? because it seems that your persistence.xml is missing the Task entity. 


--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/7e827370-9a95-49a7-a4c4-ed4ee248dc11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
 - MyJourney @ http://salaboy.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar
 
 - Salatino "Salaboy" Mauricio -

Murthy Gandikota

unread,
Feb 26, 2015, 4:22:26 PM2/26/15
to jbpm-...@googlegroups.com, gandi...@gmail.com
The examples didn't come with persistence.xml. So I 
used the one given in the book. Also I mapped Taskorm.xml 
 to overcome an exception thrown for not having it. I don't
have the JBPMorm and  Taskorm xml's. Where does the
jbpm find them?





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





<persistence

  version="2.0"








  <persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">

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

    <jta-data-source>jdbc/jbpm-ds</jta-data-source>

    <mapping-file>META-INF/JBPMorm.xml</mapping-file>
<mapping-file>META-INF/Taskorm.xml</mapping-file>
    <class>org.drools.persistence.info.SessionInfo</class>

    <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

    <class>org.drools.persistence.info.WorkItemInfo</class>

    <class>org.jbpm.persistence.correlation.CorrelationKeyInfo</class>

    <class>org.jbpm.persistence.correlation.CorrelationPropertyInfo</class>

    <class>org.jbpm.runtime.manager.impl.jpa.ContextMappingInfo</class>



    <class>org.jbpm.process.audit.ProcessInstanceLog</class>

    <class>org.jbpm.process.audit.NodeInstanceLog</class>

    <class>org.jbpm.process.audit.VariableInstanceLog</class>



    <properties>

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

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

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

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

      <property name="hibernate.transaction.jta.platform"

      value="org.hibernate.service.jta.platform.internal.BitronixJtaPlatform"/>

    </properties>

  </persistence-unit>

</persistence> 


Murthy Gandikota

unread,
Feb 26, 2015, 5:27:44 PM2/26/15
to jbpm-...@googlegroups.com
This is the error scenario that is encountered when no ORM are mapped.


Adding Taskorm.xml seems to alleviate the problem albeit temporarily before hitting the TaskImpl not mapped.

Thanks

Murthy Gandikota

unread,
Feb 26, 2015, 7:48:04 PM2/26/15
to jbpm-...@googlegroups.com
Made progress by adding these to the persistence.xml

<class>org.jbpm.services.task.impl.model.UserImpl</class>
  <class>org.jbpm.services.task.impl.model.GroupImpl</class>
     <class>org.jbpm.services.task.impl.model.DeadlineImpl</class>

But still failing the tests

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.jbpm.human.resources.tests.CDIKIEJUnitTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.328 sec <<< FAILURE!
Running org.jbpm.human.resources.tests.SimpleProcessJUnitTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.713 sec <<< FAILURE!

Results :

Tests in error: 
  org.jbpm.human.resources.tests.CDIKIEJUnitTest: org/kie/internal/task/api/TaskCommandExecutor
  simpleProcessTest(org.jbpm.human.resources.tests.SimpleProcessJUnitTest): [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory


It seems org.kie.internal.task.api.TaskCommandExecutor is a 6.0.1 version. I am currently at 6.1.0. Any ideas?

Thanks

Murthy Gandikota

unread,
Feb 26, 2015, 8:23:37 PM2/26/15
to jbpm-...@googlegroups.com
After I cleaned out human-task-services 6.0.0 jar, I am down to this error:

Tests in error: 
  org.jbpm.human.resources.tests.CDIKIEJUnitTest: java.lang.ClassNotFoundException: org.jbpm.services.task.identity.UserGroupTaskQueryServiceDecorator; location: <class>org.jbpm.services.task.identity.UserGroupTaskQueryServiceDecorator</class> in archive:/META-INF/beans.xml@16
  simpleProcessTest(org.jbpm.human.resources.tests.SimpleProcessJUnitTest): [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory

Can someone please explain what these classes are for?

If I don't comment out these in META-INF/beans.xml

<alternatives>
        <!--  use this only for standalone/test usage, remove when in application server-->  
        <class>org.jbpm.shared.services.impl.tx.BTMTransactionManagerSynchronizations</class>
       
    </alternatives>


 <!-- use this only for standalone/test usage, remove when in application server    -->
    <m:CMTBTMTransaction>
        <s:modifies />
    </m:CMTBTMTransaction>
    
    <m:BTMTransactionManagerSynchronizations>
        <s:modifies />
    </m:BTMTransactionManagerSynchronizations>

Results :

Tests in error: 
  org.jbpm.human.resources.tests.CDIKIEJUnitTest: java.lang.ClassNotFoundException: org.jbpm.shared.services.impl.tx.BTMTransactionManagerSynchronizations; location: <class>org.jbpm.shared.services.impl.tx.BTMTransactionManagerSynchronizations</class> in archive:/META-INF/beans.xml@11

Murthy Gandikota

unread,
Feb 26, 2015, 9:28:56 PM2/26/15
to jbpm-...@googlegroups.com
If I run SimpleProcessJUnitTest.java

 javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.persistence.jpa] Unable to build EntityManagerFactory

Caused by: org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: org.jbpm.services.task.impl.model.DeadlineImpl.escalations[org.jbpm.services.task.impl.model.EscalationImpl]

Murthy Gandikota

unread,
Feb 27, 2015, 12:11:20 PM2/27/15
to jbpm-...@googlegroups.com
The SimpleProcessJUnitTest ran successfully. I am posting the persistence.xml so it will be useful to others.

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





<persistence

  version="2.0"








  <persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">

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

    <jta-data-source>jdbc/jbpm-ds</jta-data-source>

     <mapping-file>META-INF/Taskorm.xml</mapping-file>
    <mapping-file>META-INF/JBPMorm.xml</mapping-file>
    <!--  
     <mapping-file>META-INF/Executor-orm.xml</mapping-file>
    <mapping-file>META-INF/Servicesorm.xml</mapping-file>
   -->
    <mapping-file>META-INF/TaskAuditorm.xml</mapping-file>
    
    
   <class>org.jbpm.services.task.impl.model.AttachmentImpl</class>
    <class>org.jbpm.services.task.impl.model.ContentImpl</class>
    <class>org.jbpm.services.task.impl.model.BooleanExpressionImpl</class>
    <class>org.jbpm.services.task.impl.model.CommentImpl</class>
    <class>org.jbpm.services.task.impl.model.DeadlineImpl</class>
    <class>org.jbpm.services.task.impl.model.DelegationImpl</class>
    <class>org.jbpm.services.task.impl.model.EscalationImpl</class>
    <class>org.jbpm.services.task.impl.model.GroupImpl</class>
    <class>org.jbpm.services.task.impl.model.I18NTextImpl</class>
    <class>org.jbpm.services.task.impl.model.NotificationImpl</class>
    <class>org.jbpm.services.task.impl.model.EmailNotificationImpl</class>
    <class>org.jbpm.services.task.impl.model.EmailNotificationHeaderImpl</class>
    <class>org.jbpm.services.task.impl.model.PeopleAssignmentsImpl</class>
    <class>org.jbpm.services.task.impl.model.ReassignmentImpl</class>
    <class>org.jbpm.services.task.impl.model.TaskImpl</class>
    <class>org.jbpm.services.task.impl.model.TaskDefImpl</class>
    <class>org.jbpm.services.task.impl.model.TaskDataImpl</class>
    <class>org.jbpm.services.task.impl.model.UserImpl</class>
    <!-- <class>org.jbpm.executor.entities.ErrorInfo</class>
    <class>org.jbpm.executor.entities.RequestInfo</class>
    -->
    <class>org.drools.persistence.info.SessionInfo</class>

<!-- Event Classes -->
    <class>org.jbpm.services.task.audit.impl.model.TaskEventImpl</class>
  <!-- Task Audit Classes --> 
    <class>org.jbpm.services.task.audit.impl.model.AuditTaskImpl</class>
    <!--BAM for task service -->
    <class>org.jbpm.services.task.audit.impl.model.BAMTaskSummaryImpl</class>

    <!-- engine -->
    <class>org.drools.persistence.info.SessionInfo</class>
    <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
    <class>org.drools.persistence.info.WorkItemInfo</class>
    <class>org.jbpm.persistence.correlation.CorrelationKeyInfo</class>
    <class>org.jbpm.persistence.correlation.CorrelationPropertyInfo</class>
    <!-- manager -->
    <class>org.jbpm.runtime.manager.impl.jpa.ContextMappingInfo</class>

    <!-- bam -->
Reply all
Reply to author
Forward
0 new messages