Try use bean "drools:kagent" with stataful knowledge session but have exception:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaSingleSessionCommandService': 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. Does the parameter type of the setter match the return type of the getter
why StatefulKnowledgeSessionBeanFactory of drools-spring do not use knowledge agent?
KnowledgeSessionDefinitionParser try set this property to factory.
<drools:kagent id="knowledgeAgent" kbase="knowledgeBase" new-instance="false">
<drools:resources>
<drools:resource type="CHANGE_SET" source="classpath:ChangeSet.xml" />
</drools:resources>
</drools:kagent>
<drools:kbase id="knowledgeBase">
<drools:resources>
<drools:resource type="BPMN2"
source="classpath:definitions/BPMN2-UserTask.bpmn2" />
</drools:resources>
<drools:configuration>
</drools:configuration>
</drools:kbase>
<drools:ksession id="jpaSingleSessionCommandService" type="stateful" kbase="knowledgeBase">
<drools:configuration>
<drools:work-item-handlers>
<drools:work-item-handler name="Human Task" ref="humanTaskHandler" />
</drools:work-item-handlers>
<drools:jpa-persistence load="1">
<drools:transaction-manager ref="transactionManager" />
<drools:entity-manager-factory ref="entityManagerFactory" />
</drools:jpa-persistence>
</drools:configuration>
</drools:ksession>