Archive for July 14, 2011

jbpm5 and Jboss AS 7 – little issue

Hi, all!

Recently I tried to deploy a web application in JBoss AS 7 that contains some jbpm 5 dependencies on its pom.xml.
Unfortunately I got stucked into a weird error – “Deployment of “ui.war” was rolled back with failure message {“Services with missing/unavailable dependencies” => [“jboss.persistenceunit.\”ui.war#org.jbpm.task\” missing [ jboss.data-source.java:/ ]“]” [see the image below]:

So, as I was a jbpm newbie, I decided to take a look at docs to try to answers some questions about this, after taking some time asking my self “Y U NO WORK?”
The problem is that the dependency

<groupId>org.jbpm</groupId></pre>
<artifactId>jbpm-human-task</artifactId>

contains a persistence.xml file with this content:

 <?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.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="false" />
    </properties>
  </persistence-unit>
</persistence> 
AS 7 gets crazy about it because it reads this file from jbpm-human-task jar and cannot find the <jta-data-source> tag! Even if you create a new persistence.xml file containing this persistence unit and try to point a jta-data-source, it will not work, because JBoss AS still reads this persistence inside this jar!
After I realized that, I found some bug reports (here and here) talking about similar issues.
For while I dont think there’s a fix for that. If you want to test you application without jbpm-human-task features, I suggest you to add this lines of exclusion into your pom.xml:
<exclusions><exclusion>

<groupId>org.jbpm</groupId>

<artifactId>jbpm-human-task</artifactId>

</exclusion>

</exclusions>

Edited: Sures, removing the module is the worst solution in the world. I just blogged to show you where the problem was. I suggest you clone jbpm project at github (you will have to clone Drools project also). After that, remover the persistence file into human-task module and rebuild it (tip – manually remove jbpm into your local maven repository. This will avoid lots of problems. Then, create a persistence.xml with this content, and just add the tag <jta-data-source>. Finally, run mvn -o clean install into the project that depends on jbpm. )

July 14, 2011 at 3:01 pm 5 comments


Calendar

July 2011
M T W T F S S
« Jun   Aug »
 123
45678910
11121314151617
18192021222324
25262728293031

Posts by Month

Posts by Category


Follow

Get every new post delivered to your Inbox.