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

ReloadSessionTest fails when trying to unmarshall the session

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 5.3.0.CR1
    • Fix Version/s: 5.3.0.CR1
    • Component/s: drools-core
    • Labels:
      None

      Description

      Unmarshalling a marshalled session fails when a fact has been inserted into the session.

      This can be seen in the org.drools.persistence.session.ReloadSessionTest, which fails at the moment.

      An npe is thrown here:

      ConcurrentNodeMemories.getNodeMemory(NodeMemory) line: 65	
      ReteooStatefulSession(AbstractWorkingMemory).getNodeMemory(NodeMemory) line: 1040	
      InputMarshaller.readFactHandles(MarshallerReaderContext) line: 373	
      InputMarshaller.readSession(MarshallerReaderContext, int, ExecutorService, Environment, SessionConfiguration) line: 255	
      DefaultMarshaller.unmarshall(InputStream, KnowledgeSessionConfiguration, Environment) line: 92	
      SessionMarshallingHelper.loadSnapshot(byte[], StatefulKnowledgeSession) line: 91	
      SingleSessionCommandService.initKsession(Integer, KnowledgeBase, KnowledgeSessionConfiguration) line: 221	
      

      This only happens when the knowledge base is reinitialized before reloading the statefulKnowledgeSession:

      KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
      kbuilder.add( ResourceFactory.newByteArrayResource(rule.getBytes()), ResourceType.DRL);
      
      if (kbuilder.hasErrors()) {
          fail(kbuilder.getErrors().toString());
      }
      
      KnowledgeBase newkbase = KnowledgeBaseFactory.newKnowledgeBase();
      kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
      
      StatefulKnowledgeSession newCommandKSession 
          = JPAKnowledgeService.loadStatefulKnowledgeSession(sessionInfoId, newkbase, null, env);
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  marco.rietveld Marco Rietveld
                  Reporter:
                  marco.rietveld Marco Rietveld
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: