{"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.persistenceunit.\"s2s3h4j5.war#myJPA\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"s2s3h4j5.war#myJPA\": Failed to start service"},"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.persistenceunit.\"s2s3h4j5.war#org.jbpm.persistence.jpa\"jboss.naming.context.java.jdbc.jbpm-dsMissing[jboss.persistenceunit.\"s2s3h4j5.war#org.jbpm.persistence.jpa\"jboss.naming.context.java.jdbc.jbpm-ds]"]}}}
我的persistence.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
version="2.0">
org.hibernate.ejb.HibernatePersistence
META-INF/ProcessInstanceInfo.hbm.xml
META-INF/JBPMorm.xml
META-INF/Taskorm.xml
org.jbpm.task.Attachment
org.jbpm.task.Content
org.jbpm.task.BooleanExpression
org.jbpm.task.Comment
org.jbpm.task.Deadline
org.jbpm.task.Comment
org.jbpm.task.Deadline
org.jbpm.task.Delegation
org.jbpm.task.Escalation
org.jbpm.task.Group
org.jbpm.task.I18NText
org.jbpm.task.Notification
org.jbpm.task.EmailNotification
org.jbpm.task.EmailNotificationHeader
org.jbpm.task.PeopleAssignments
org.jbpm.task.Reassignment
org.jbpm.task.Status
org.jbpm.task.Task
org.jbpm.task.TaskData
org.jbpm.task.SubTasksStrategy
org.jbpm.task.OnParentAbortAllSubTasksEndStrategy
org.jbpm.task.OnAllSubTasksEndParentEndStrategy
org.jbpm.task.User
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
<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>
applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
">
<bean id="entityManagerFactory "
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="baseDataSource"/>
<property name="persistenceUnitName" value="myJPA" />
<property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" />
</bean>
<bean id="jbpmEM"
class="org.springframework.orm.jpa.support.SharedEntityManagerBean">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<!--Hibernate TransactionManager myJPA-->
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
<property name="nestedTransactionAllowed" value="false" />
</bean>
<bean id="baseDataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/jbpmdemo" />
<property name="username" value="root" />
<property name="password" value="" />
</bean>
<!-- 事务拦截 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*" read-only="false" rollback-for="java.lang.Throwable" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="projectServiceOperation"
expression="execution(* com.lian.service..*.*(..))" />
<aop:advisor pointcut-ref="projectServiceOperation"
advice-ref="txAdvice" />
</aop:config>
我用的是struts2.3 spring3.1 hibernate4.1 jbpm5.4 jboss7.1