Rafael Soledade
2013-01-03 17:04:05 UTC
Rafael Soledade [https://community.jboss.org/people/rafaelsoledadem] created the discussion
"persistence unit error in jboss"
To view the discussion, visit: https://community.jboss.org/message/787387#787387
--------------------------------------------------------------
Hi,
I'm having some trouble while running my jBPM project on jboss 5. Just before the server starts, I get an error:
DEPLOYMENTS IN ERROR:
    Deployment "persistence.unit:unitName=myProj.ear/#BPM-DB" is in error due to the following reason(s): java.lang.ClassNotFoundException: org.jbpm.persistence.ProcessInstanceInfo from BaseClassLoader{jboss_project_path/jboss-service.xml}
I really can't understand why this happens, since I have the orm.xml, persistence.xml and ProcessInstanceInfo.hbm.xml. Can anyone help me with this? Google has not been my friend on this subject.
---------
*ProcessInstanceInfo.hbm.xml*
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
       " http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="org.jbpm.persistence.processinstance">
   <!-- access="field" for fields that have no setter methods -->
   <class name="ProcessInstanceInfo" table="ProcessInstanceInfo">
       <id name="processInstanceId" type="long" column="InstanceId">
           <generator class="native" />
       </id>
       <version name="version" type="integer" unsaved-value="null" access="field">
         <column name="OPTLOCK" not-null="false" />
       </version>
       <property name="processId" access="field" />
       <property name="startDate" type="timestamp" access="field" />
       <property name="lastReadDate" type="timestamp" access="field" />
       <property name="lastModificationDate" type="timestamp" access="field" />
       <property name="state" type="integer" not-null="true" access="field" />
      <property name="processInstanceByteArray" type="org.hibernate.type.PrimitiveByteArrayBlobType"
           column="processInstanceByteArray" access="field" length="2147483647" />
       <set name="eventTypes" table="EventTypes" access="field" >
           <key column="InstanceId"/>
           <element column="element" type="string"/>
       </set>
       <!-- NOT mapping [processInstance] field because field is transient -->  Â
       <!-- NOT mapping [env] field because field is transient -->  Â
   </class>
</hibernate-mapping>
-------
*persistence.xml*
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence version="2.0"
         xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence
                                http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
                                http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm
                                http://java.sun.com/xml/ns/persistence/orm_2_0.xsd http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
         xmlns:orm=" http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
         xmlns=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence">
         <persistence-unit name="BPM-DB" transaction-type="JTA">
                   <provider>org.hibernate.ejb.HibernatePersistence</provider>
                   <jta-data-source>java:/DefaultDS</jta-data-source>
                   <mapping-file>META-INF/JBPMorm-JPA2.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.default_schema" value="bpmdata" />
                             <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
                             <property name="hibernate.connection.autocommit" value="false" />
                             <property name="hibernate.hbm2ddl.auto" value="create" />
                             <property name="hibernate.show_sql" value="false" />
                             <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory" />
                             <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
                             <property name="hibernate.transaction.flush_before_completion" value="true" />
                   </properties>
         </persistence-unit>
</persistence>
-------------------
*orm.xml*
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns=" http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm"
         xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
         version="1.0">
         <named-query name="ProcessInstancesWaitingForEvent">
                   <query>
                             select
                             processInstanceInfo.processInstanceId
                             from
                             ProcessInstanceInfo processInstanceInfo
                             where
                             :type in elements(processInstanceInfo.eventTypes)
         </query>
         </named-query>
</entity-mappings>
*
*
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/787387#787387]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
"persistence unit error in jboss"
To view the discussion, visit: https://community.jboss.org/message/787387#787387
--------------------------------------------------------------
Hi,
I'm having some trouble while running my jBPM project on jboss 5. Just before the server starts, I get an error:
DEPLOYMENTS IN ERROR:
    Deployment "persistence.unit:unitName=myProj.ear/#BPM-DB" is in error due to the following reason(s): java.lang.ClassNotFoundException: org.jbpm.persistence.ProcessInstanceInfo from BaseClassLoader{jboss_project_path/jboss-service.xml}
I really can't understand why this happens, since I have the orm.xml, persistence.xml and ProcessInstanceInfo.hbm.xml. Can anyone help me with this? Google has not been my friend on this subject.
---------
*ProcessInstanceInfo.hbm.xml*
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
       " http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="org.jbpm.persistence.processinstance">
   <!-- access="field" for fields that have no setter methods -->
   <class name="ProcessInstanceInfo" table="ProcessInstanceInfo">
       <id name="processInstanceId" type="long" column="InstanceId">
           <generator class="native" />
       </id>
       <version name="version" type="integer" unsaved-value="null" access="field">
         <column name="OPTLOCK" not-null="false" />
       </version>
       <property name="processId" access="field" />
       <property name="startDate" type="timestamp" access="field" />
       <property name="lastReadDate" type="timestamp" access="field" />
       <property name="lastModificationDate" type="timestamp" access="field" />
       <property name="state" type="integer" not-null="true" access="field" />
      <property name="processInstanceByteArray" type="org.hibernate.type.PrimitiveByteArrayBlobType"
           column="processInstanceByteArray" access="field" length="2147483647" />
       <set name="eventTypes" table="EventTypes" access="field" >
           <key column="InstanceId"/>
           <element column="element" type="string"/>
       </set>
       <!-- NOT mapping [processInstance] field because field is transient -->  Â
       <!-- NOT mapping [env] field because field is transient -->  Â
   </class>
</hibernate-mapping>
-------
*persistence.xml*
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence version="2.0"
         xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence
                                http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
                                http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm
                                http://java.sun.com/xml/ns/persistence/orm_2_0.xsd http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
         xmlns:orm=" http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
         xmlns=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence">
         <persistence-unit name="BPM-DB" transaction-type="JTA">
                   <provider>org.hibernate.ejb.HibernatePersistence</provider>
                   <jta-data-source>java:/DefaultDS</jta-data-source>
                   <mapping-file>META-INF/JBPMorm-JPA2.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.default_schema" value="bpmdata" />
                             <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
                             <property name="hibernate.connection.autocommit" value="false" />
                             <property name="hibernate.hbm2ddl.auto" value="create" />
                             <property name="hibernate.show_sql" value="false" />
                             <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory" />
                             <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
                             <property name="hibernate.transaction.flush_before_completion" value="true" />
                   </properties>
         </persistence-unit>
</persistence>
-------------------
*orm.xml*
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns=" http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm"
         xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
         version="1.0">
         <named-query name="ProcessInstancesWaitingForEvent">
                   <query>
                             select
                             processInstanceInfo.processInstanceId
                             from
                             ProcessInstanceInfo processInstanceInfo
                             where
                             :type in elements(processInstanceInfo.eventTypes)
         </query>
         </named-query>
</entity-mappings>
*
*
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/787387#787387]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]