Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-2955

drools-spring: exception if you define a stateful ksession after a kagent in configuration file

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Hide

      Try to create a spring context from this configuration file:

      <drools:kbase id="kbase1" node="node1"/>
      <drools:kagent id="kagent1" kbase="kbase1" new-instance="false"/>
      <drools:ksession id="ksession1" type="stateful" kbase="kbase1" node="node1"/>

      Show
      Try to create a spring context from this configuration file: <drools:kbase id="kbase1" node="node1"/> <drools:kagent id="kagent1" kbase="kbase1" new-instance="false"/> <drools:ksession id="ksession1" type="stateful" kbase="kbase1" node="node1"/>
    • Workaround Exists
    • Hide

      Define all your stateful sessions BEFORE your kagents

      Show
      Define all your stateful sessions BEFORE your kagents
    • Low

    Description

      An exception occurs if you define a stateful ksession AFTER a kagent in spring's config file.
      The problem is that drools-spring will try to set the kagent attribute of the session. This attribute only exists for stateless ksessions.

      The exception you get is:
      Exception in thread "main"
      org.springframework.beans.factory.BeanCreationException: Error creating bean
      with name 'ksession2': Error setting property values; nested exception is
      org.springframework.beans.NotWritablePropertyException: Invalid property
      'knowledgeAgent' of bean class
      [org.drools.container.spring.beans.StatefulKnowledgeSessionBeanFactory]:
      Bean property 'knowledgeAgent' is not writable or has an invalid setter
      method.

      Attachments

        Activity

          People

            esteban.aliverti@gmail.com Esteban Aliverti (Inactive)
            esteban.aliverti@gmail.com Esteban Aliverti (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty