Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-5154

Workbench compilation fails if no default stateful session is defined

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • jBPM 6.4.0.Final
    • Runtime Engine
    • NEW
    • NEW
    • Hide

      Create a kjar project and edit the kmodule.xml like the example above. Click on "build & deploy".

      Show
      Create a kjar project and edit the kmodule.xml like the example above. Click on "build & deploy".

    Description

      If no default stateful session is defined in the kjar, an exception is raised when the user clicks on "build & deploy" in the workbench:

      Caused by: java.lang.IllegalStateException: Cannot find ksession, either it does not exist or there are multiple default ksession in kmodule.xml
      at org.jbpm.services.cdi.impl.manager.InjectableRegisterableItemsFactory.getWorkItemHandlers(InjectableRegisterableItemsFactory.java:158) [jbpm-services-cdi-6.4.0.Final-redhat-3.jar:6.4.0.Final-redhat-3]
      at org.jbpm.runtime.manager.impl.AbstractRuntimeManager.registerItems(AbstractRuntimeManager.java:119) [jbpm-runtime-manager-6.4.0.Final-redhat-3.jar:6.4.0.Final-redhat-3]

      The problem is caused because jBPM is assuming that there will always be a default statefull session here:

      https://github.com/droolsjbpm/jbpm/blob/master/jbpm-services/jbpm-services-cdi/src/main/java/org/jbpm/services/cdi/impl/manager/InjectableRegisterableItemsFactory.java#L149

      A kjar can be defined only with stateless sessions though. For instance, a valid kmodule.xml could look like:

      <kmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jboss.org/kie/6.0.0/kmodule">
      <kbase name="ScoreBase" default="true">
      <ksession name="ScoreSession" type="stateless" default="true"/>
      </kbase>
      </kmodule>

      The kmodule.xml above triggers the problem.

      Attachments

        Issue Links

          Activity

            People

              swiderski.maciej Maciej Swiderski (Inactive)
              etirelli@redhat.com Edson Tirelli
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: