1 Reply Latest reply on May 14, 2015 9:18 PM by Tajiri Ujasiri

    WAR in AS 7.1 deployment fails with JBAS014771: Services with missing/unavailable dependencies (persistence unit not found)

    Tajiri Ujasiri Newbie

      I've seen a few posts with similar subject lines, but none have addressed my issue.  I'm attempting to deploy a simple Dynamic Web Project, using Spring, that drives a 2 node JBPM process.

       

      server.log:

       

      
      14:47:00,426 INFO  [org.jboss.as.jpa] (MSC service thread 1-12) JBAS011401: Read persistence.xml for org.persistence.unit
      14:47:00,646 INFO  [org.jboss.weld.deployer] (MSC service thread 1-7) JBAS016002: Processing weld deployment BriefReqPersistSPRING.war
      14:47:00,659 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-7) JNDI bindings for session bean named AvailableJobsExecutor in deployment unit deployment "BriefReqPersistSPRING.war" are as follows:
      
              java:global/BriefReqPersistSPRING/AvailableJobsExecutor!org.jbpm.executor.impl.AvailableJobsExecutor
              java:app/BriefReqPersistSPRING/AvailableJobsExecutor!org.jbpm.executor.impl.AvailableJobsExecutor
              java:module/AvailableJobsExecutor!org.jbpm.executor.impl.AvailableJobsExecutor
              java:global/BriefReqPersistSPRING/AvailableJobsExecutor
              java:app/BriefReqPersistSPRING/AvailableJobsExecutor
              java:module/AvailableJobsExecutor
      
      14:47:00,693 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-7) JNDI bindings for session bean named RetryTrackerSingleton in deployment unit deployment "BriefReqPersistSPRING.war" are as follows:
      
              java:global/BriefReqPersistSPRING/RetryTrackerSingleton!org.kie.remote.services.jms.RetryTrackerSingleton
              java:app/BriefReqPersistSPRING/RetryTrackerSingleton!org.kie.remote.services.jms.RetryTrackerSingleton
              java:module/RetryTrackerSingleton!org.kie.remote.services.jms.RetryTrackerSingleton
              java:global/BriefReqPersistSPRING/RetryTrackerSingleton
              java:app/BriefReqPersistSPRING/RetryTrackerSingleton
              java:module/RetryTrackerSingleton
      
      14:47:00,748 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-14) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
      14:47:00,762 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-14) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
      14:47:00,771 INFO  [org.jboss.weld.deployer] (MSC service thread 1-14) JBAS016005: Starting Services for CDI deployment: BriefReqPersistSPRING.war
      14:47:00,833 INFO  [org.jboss.wsf.stack.cxf.metadata.MetadataBuilder] (MSC service thread 1-14) Add Service
      id=org.kie.remote.services.ws.command.CommandWebServiceImpl
      address=http://localhost:8080/BriefReqPersistSPRING/CommandService
      implementor=org.kie.remote.services.ws.command.CommandWebServiceImpl
      invoker=org.jboss.wsf.stack.cxf.JBossWSInvoker
      serviceName={http://services.remote.kie.org/6.1.0.1/command}CommandService
      portName={http://services.remote.kie.org/6.1.0.1/command}CommandServicePort
      wsdlLocation=null
      mtomEnabled=false
      14:47:00,877 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-14) Creating Service {http://services.remote.kie.org/6.1.0.1/command}CommandService from class org.kie.remote.services.ws.wsdl.generated.CommandWebService
      14:47:01,091 INFO  [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-14) Setting the server's publish address to be http://localhost:8080/BriefReqPersistSPRING/CommandService
      14:47:01,135 INFO  [org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher] (MSC service thread 1-14) WSDL published to: file:/Users/tajiriujasiri/test/jbpm-installer/jboss-as-7.1.1.Final/standalone/data/wsdl/BriefReqPersistSPRING.war/CommandService.wsdl
      14:47:01,149 INFO  [org.jboss.as.webservices] (MSC service thread 1-7) JBAS015539: Starting service jboss.ws.port-component-link
      14:47:01,157 INFO  [org.jboss.as.webservices] (MSC service thread 1-7) JBAS015539: Starting service jboss.ws.endpoint."BriefReqPersistSPRING.war"."org.kie.remote.services.ws.command.CommandWebServiceImpl"
      14:47:01,168 INFO  [org.jboss.ws.common.management.DefaultEndpointRegistry] (MSC service thread 1-7) register: jboss.ws:context=BriefReqPersistSPRING,endpoint=org.kie.remote.services.ws.command.CommandWebServiceImpl
      14:47:01,381 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "BriefReqPersistSPRING.war" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"BriefReqPersistSPRING.war\".WeldServicejboss.persistenceunit.\"BriefReqPersistSPRING.war#org.persistence.unit\"Missing[jboss.deployment.unit.\"BriefReqPersistSPRING.war\".WeldServicejboss.persistenceunit.\"BriefReqPersistSPRING.war#org.persistence.unit\"]"]}
      14:47:01,387 INFO  [org.jboss.as.webservices] (MSC service thread 1-6) JBAS015540: Stopping service jboss.ws.endpoint."BriefReqPersistSPRING.war"."org.kie.remote.services.ws.command.CommandWebServiceImpl"
      14:47:01,430 INFO  [org.jboss.ws.common.management.DefaultEndpointRegistry] (MSC service thread 1-6) remove: jboss.ws:context=BriefReqPersistSPRING,endpoint=org.kie.remote.services.ws.command.CommandWebServiceImpl
      14:47:01,443 INFO  [org.jboss.as.webservices] (MSC service thread 1-4) JBAS015540: Stopping service jboss.ws.port-component-link
      14:47:01,510 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015877: Stopped deployment BriefReqPersistSPRING.war in 128ms
      14:47:01,517 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report
      JBAS014776:    Newly corrected services:
            service jboss.persistenceunit."BriefReqPersistSPRING.war#org.persistence.unit" (new available)
      
      14:47:01,530 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"BriefReqPersistSPRING.war\".WeldServicejboss.persistenceunit.\"BriefReqPersistSPRING.war#org.persistence.unit\"Missing[jboss.deployment.unit.\"BriefReqPersistSPRING.war\".WeldServicejboss.persistenceunit.\"BriefReqPersistSPRING.war#org.persistence.unit\"]"]}}}
      
      
      

       

      persistence.xml:

       

      
      <?xml version="1.0" encoding="UTF-8"?>
      <persistence version="2.0"
        xmlns="http://java.sun.com/xml/ns/persistence" 
        xmlns:orm="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 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_2_0.xsd">
      
        <persistence-unit name="org.persistence.unit" transaction-type="JTA">
        <!--persistence-unit name="org.persistence.unit" transaction-type="RESOURCE_LOCAL"-->
          <provider>org.hibernate.ejb.HibernatePersistence</provider>
          <jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source>
         
          <mapping-file>META-INF/JBPMorm.xml</mapping-file>
          <mapping-file>META-INF/Taskorm.xml</mapping-file>
          <mapping-file>META-INF/TaskAuditorm.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>
         
          <class>org.jbpm.persistence.correlation.CorrelationKeyInfo</class>
          <class>org.jbpm.persistence.correlation.CorrelationPropertyInfo</class>
         
          <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.TaskDataImpl</class>
          <class>org.jbpm.services.task.impl.model.UserImpl</class>
         
          <!--BAM for task service -->
          <class>org.jbpm.services.task.audit.impl.model.BAMTaskSummaryImpl</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>
      
         
      
          <properties>
      
          <!-- SPRING-->
        <property name="jboss.as.jpa.providerModule" value="application" />
                    <property name="jboss.as.jpa.managed" value="false" /> 
          <!-- SPRING-->
                 
      
                  <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
                  <property name="hibernate.show_sql" value="true" />
                  <property name="hibernate.hbm2ddl.auto" value="update" />   
         
      
            <property name="hibernate.max_fetch_depth" value="3" />
            
            <!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->
            <property name="hibernate.id.new_generator_mappings" value="false" />
           
            <!--property name="hibernate.transaction.jta.platform"  value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform"/-->
           
            <property name="hibernate.transaction.jta.platform"  value="org.hibernate.service.jta.platform.internal.BitronixJtaPlatform"/>
           
            <!--property name="hibernate.transaction.jta.platform"  value="org.hibernate.service.jta.platform.internal.BitronixJtaPlatform"/-->
            <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory" />
           
            <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
           
          </properties>
        </persistence-unit>
      
      </persistence>
      
      

       

      web.xml:

       

      
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
          id="WebApp_ID" version="3.0" >
         <display-name>Process Test</display-name>
          <welcome-file-list>
              <welcome-file>/index.jsp</welcome-file>
          </welcome-file-list>
      
          <servlet>
              <servlet-name>springDispatcher</servlet-name>
              <servlet-class>
                  org.springframework.web.servlet.DispatcherServlet
              </servlet-class>
            <init-param>
                  <param-name>contextConfigLocation</param-name>
                  <param-value>/WEB-INF/config/applicationContextBPMN.xml</param-value>
              </init-param>
              <load-on-startup>1</load-on-startup>
          </servlet>
          <servlet-mapping>
              <servlet-name>springDispatcher</servlet-name>
              <url-pattern>/</url-pattern>
          </servlet-mapping>
      </web-app>
      
      

       

      Java:

       

      
      ApplicationContext context = new ClassPathXmlApplicationContext("file:src/main/resources/WEB-INF/config/applicationContextBPMN.xml");
      
        emf = (EntityManagerFactory)context.getBean("jbpmEMF");
      

       

       

      applicationContextBPMN.xml:

       

      
      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:util="http://www.springframework.org/schema/util"
             xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                                http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
      
        <bean id="jbpmEMF" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
          <property name="persistenceUnitName" value="org.persistence.unit.short"/>
          <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml"/>
        </bean>
      
        <bean id="jbpmTxManager" class="org.springframework.orm.jpa.JpaTransactionManager">
          <property name="entityManagerFactory" ref="jbpmEMF"/>
        </bean>
      
        <bean id="process" factory-method="newClassPathResource" class="org.kie.internal.io.ResourceFactory">
          <constructor-arg>
            <value>META-INF/briefverify_mod.bpmn2</value>
          </constructor-arg>
        </bean>
      
        <bean id="runtimeEnvironment" class="org.kie.spring.factorybeans.RuntimeEnvironmentFactoryBean">
          <property name="type" value="DEFAULT"/>
      <!--    <property name="entityManager" ref="sharedEntityManagerBean"/>-->
          <property name="entityManagerFactory" ref="jbpmEMF"/>
          <property name="transactionManager" ref="jbpmTxManager"/>
          <!--property name="pessimisticLocking" value="true"/-->
          <property name="assets">
            <map>
              <entry key-ref="process"><util:constant static-field="org.kie.api.io.ResourceType.BPMN2"/></entry>
            </map>
          </property>
        </bean>
      
        <bean id="runtimeManager" class="org.kie.spring.factorybeans.RuntimeManagerFactoryBean" destroy-method="close">
          <property name="type" value="PER_REQUEST" />
          <property name="identifier" value="spring-rm"/>
          <property name="runtimeEnvironment" ref="runtimeEnvironment"/>
        </bean>
      
        <bean id="logService" class="org.jbpm.process.audit.JPAAuditLogService">
          <constructor-arg>
            <ref bean="jbpmEMF"/>
          </constructor-arg>
          <constructor-arg>
            <value>STANDALONE_LOCAL_SPRING_SHARED_EM</value>
          </constructor-arg>
        </bean>
      </beans>