Details
-
Bug
-
Resolution: Done
-
Major
-
5.1.0.CR1
-
-
Low
Description
private JPAKnowledgeFactoryService jpaKnowledgeServiceProvider;
in "JPAKnowledgeServiceBean" is not initialized. It used to be by:
protected void initDao() {
... ... ...
jpaKnowledgeServiceProvider = node.get( JPAKnowledgeFactoryService.class );
if ( jpaKnowledgeServiceProvider instanceof JPAKnowledgeProviderLocalClient )
else
{ throw new RuntimeDroolsException( "JPAKnowledgeService is not instance of: " + JPAKnowledgeProviderLocalClient.class.getName() ); }}
but now this code is commented out [ in the latest SNAPSHOT as well ]. Therefore both:
public StatefulKnowledgeSession newStatefulKnowledgeSession() {}
and
public StatefulKnowledgeSession loadStatefulKnowledgeSession(final int sessionId) {}
FAIL, since they use jpaKnowledgeServiceProvider to create / load Sessions:
return jpaKnowledgeServiceProvider.newStatefulKnowledgeSession..
return jpaKnowledgeServiceProvider.loadStatefulKnowledgeSession..
-------------------------------------------------------------------------------------------------------------------
I understand "SpringSingleSessionCommandService" was removed, but this is not the reason to document the whole thing as it breaks the code base that depends on it.
-------------------------------------------------------------------------------------------------------------------
If "JPAKnowledgeServiceBean" is deprecated, or a different configuration required, please advise. Is it documented?
Thank you,
/Anatoly
Exception to be indexed by Google:
java.lang.NullPointerException
at org.drools.container.spring.beans.persistence.JPAKnowledgeServiceBean$1$1.doInJpa(JPAKnowledgeServiceBean.java:42)
at org.drools.container.spring.beans.persistence.JPAKnowledgeServiceBean$1$1.doInJpa(JPAKnowledgeServiceBean.java:41)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:183)
at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:146)
at org.drools.container.spring.beans.persistence.JPAKnowledgeServiceBean$1.doInTransaction(JPAKnowledgeServiceBean.java:40)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.drools.container.spring.beans.persistence.JPAKnowledgeServiceBean.newStatefulKnowledgeSession(JPAKnowledgeServiceBean.java:38)