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

ReloadSessionTest fails when trying to unmarshall the session

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Minor
    • 5.3.0.CR1
    • 5.3.0.CR1
    • drools-core
    • 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);
      

      Attachments

        Issue Links

          Activity

            People

              marco.rietveld Marco Rietveld (Inactive)
              marco.rietveld Marco Rietveld (Inactive)
              Archiver:
              rhn-support-ceverson Clark Everson

              Dates

                Created:
                Updated:
                Resolved:
                Archived:

                PagerDuty