[jboss-user] [jBPM] - JBPM Console Process List Error

Timothy Charman do-not-reply at jboss.com
Wed Mar 14 05:26:26 EDT 2012


Timothy Charman [https://community.jboss.org/people/tcharman] created the discussion

"JBPM Console Process List Error"

To view the discussion, visit: https://community.jboss.org/message/723692#723692

--------------------------------------------------------------
Hi

I've tried installing JBPM console 5.2 (downloaded war) and 5.3 (compiled myself with maven) at separate times.  I am running in JBoss AS 7.0.2.

In both cases I changed the login provider to be JAAS filesystem based/container managed.  I also changed the persistence to use MySQL through a JNDI datasource.

If anyone has any ideas it would be much, much appreciated.  I just want to see my process in the web UI console.  Please  :) .
h4. Dom4j Error
In both versions I get:
Caused by: org.dom4j.DocumentException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
when deploying jbpm-gwt-console-server.  To remedy this, I removed both dom4j jars (1.6 and 1.6.1) from WEB-INF/lib in the jbpm-gwt-console-server.  This lets me get past deployment.

I can log in to JBPM console server with no errors.  I get an error in rendering the task pane, but that seems to go away after the first time it renders.  I would paste it here, but the error has not occurred since I set the process pane to be default on login.

h4. Errors in Console Server Process Pane 
I navigate to the process pane, hit refresh, and in both versions (5.2 and 5.3) I get an error.

*5.2 gives this error:*

19:03:49,119 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/gwt-console-server].[Resteasy]] (http--0.0.0.0-8080-7) Servlet.service() for servlet Resteasy threw exception: org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: Could not initialize stateful knowledge session: No Persistence provider for EntityManager named org.jbpm.persistence.jpa

*5.3 gives this error:*

21:51:50,067 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/gwt-console-server].[Resteasy]] (http--0.0.0.0-8080-4) Servlet.service() for servlet Resteasy threw exception: org.jboss.resteasy.spi.UnhandledException: java.lang.NoClassDefFoundError: Could not initialize class org.jbpm.integration.console.StatefulKnowledgeSessionUtil$SessionHolder

h4. Persistence Config
In both cases Hibernate is set to create the database, and the tables do get created.  I also set showsql to true, and I can see the database being created.
h5. hibernate.cfg.xml
In the jbpm-gwt-console-server jar my WEB-INF/classes/META-INF/hibernate.cfg.xml looks like this:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <!-- Database connection settings -->
        <property name="connection.datasource">java:jboss/datasources/jbpm</property>
        <!-- JDBC connection pool (use the built-in) -->
        <property name="connection.pool_size">1</property>
        <!-- SQL dialect -->
        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
        <!-- Enable Hibernate's automatic session context management -->
        <property name="current_session_context_class">thread</property>
        <!-- Disable the second-level cache  -->
        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
        <!-- Echo all executed SQL to stdout -->
        <property name="show_sql">true</property>
        <!-- Drop and re-create the database schema on startup -->
        <property name="hbm2ddl.auto">create</property>
        <mapping resource="AuditLog.hbm.xml"/>
    </session-factory>
</hibernate-configuration>

h5. persistence.xml
and my WEB-INF/classes/META-INF/persistence.xml looks like this (5.2):

<?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.jbpm.persistence.jpa" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>java:jboss/datasources/jbpm</jta-data-source>
    <mapping-file>META-INF/JBPMorm.xml</mapping-file>
    <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
    <class>org.drools.persistence.info.SessionInfo</class>
    <class>org.drools.persistence.info.WorkItemInfo</class>
    <properties>
      <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
      <property name="hibernate.max_fetch_depth" value="3"/>
      <property name="hibernate.hbm2ddl.auto" value="create" />
      <property name="hibernate.show_sql" value="true" />
      <property name="hibernate.transaction.manager_lookup_class" value="org.jbpm.integration.console.JBPMTransactionManager" />
    </properties>
  </persistence-unit>
</persistence>

and like this in 5.3:

<?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.jbpm.persistence.jpa" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>java:jboss/datasources/jbpm</jta-data-source>
    <mapping-file>META-INF/JBPMorm.xml</mapping-file>
    <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
    <class>org.drools.persistence.info.SessionInfo</class>
    <class>org.drools.persistence.info.WorkItemInfo</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.MySQLDialect"/>
      <property name="hibernate.max_fetch_depth" value="3"/>
      <property name="hibernate.hbm2ddl.auto" value="create" />
      <property name="hibernate.show_sql" value="true" />
      <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
    </properties>
  </persistence-unit> 
</persistence>
h5. JBPMorm.xml
and finally my WEB-INF/classes/META-INF/JBPMorm.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
               version="2.0">
      <named-query name="ProcessInstancesWaitingForEvent">
          <query>
select
    processInstanceInfo.processInstanceId
from
    ProcessInstanceInfo processInstanceInfo join processInstanceInfo.eventTypes eventTypes
where
    eventTypes = :type
          </query>
      </named-query>
<sql-result-set-mapping name="ProcessInstancesWaitingForEvent.mapping">
  <column-result name="InstanceId" />
</sql-result-set-mapping>
<entity class="org.jbpm.persistence.processinstance.ProcessInstanceInfo">
    <attributes>
        <element-collection name="eventTypes">
            <collection-table name="EventTypes">
                <join-column name="InstanceId" />
            </collection-table>
        </element-collection>
    </attributes>
</entity> 
</entity-mappings>
h5. JBPMorm.xml error
Here you will see that I followed someone's (I forget whose) note that suggests changing JBPMorm.xml following getting this error:

Caused by: org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: ProcessInstanceInfo, for columns: [org.hibernate.mapping.Column(eventTypes)]
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/723692#723692]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120314/85ab9e49/attachment-0001.html 


More information about the jboss-user mailing list