Uploaded image for project: 'JBoss BPMS Platform'
  1. JBoss BPMS Platform
  2. RHBPMS-3335

NPE when entry-point is not set for InsertObjectCommand

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.0.0
    • 6.0.0
    • jBPM Core

      Description of problem:

      I receive the NPE when I try to create XStream XML BatchExecutionHelper.newXStreamMarshaller().toXML(command);

      To create the batch execution command I proceed:

      Message mo = new Message();
      mo.setText("ahoj");
      InsertObjectCommand c = new InsertObjectCommand(mo, "message");

      List<Command<?>> cmds = new ArrayList<Command<?>>();
      Command insertObjectCommand = CommandFactory.newInsert(mo, "message", true, "DEFAULT"); // here I must set the DEFAULT entry point otherwise I get the NPE
      cmds.add( insertObjectCommand );
      cmds.add(CommandFactory.newFireAllRules());

      BatchExecutionCommand command = CommandFactory.newBatchExecution(cmds, "ksession1");

      Below is the stacktrace of NPE.

      java.lang.NullPointerException
      at com.thoughtworks.xstream.io.xml.PrettyPrintWriter.writeText(PrettyPrintWriter.java:231)
      at com.thoughtworks.xstream.io.xml.PrettyPrintWriter.writeAttributeValue(PrettyPrintWriter.java:223)
      at com.thoughtworks.xstream.io.xml.PrettyPrintWriter.addAttribute(PrettyPrintWriter.java:218)
      at com.thoughtworks.xstream.io.WriterWrapper.addAttribute(WriterWrapper.java:41)
      at org.drools.core.runtime.help.impl.XStreamXML$InsertConverter.marshal(XStreamXML.java:116)

      It should be enough to set "private String entryPoint = "DEFAULT";" in InsertObjectCommand

      Version-Release number of selected component (if applicable):

      How reproducible:

      Steps to Reproduce:
      1.
      2.
      3.

      Actual results:

      Expected results:

      Additional info:

              kverlaen@redhat.com Kris Verlaenen
              ibek1@redhat.com Ivo Bek
              Ivo Bek Ivo Bek
              Ivo Bek Ivo Bek
              Anne-Louise Tangring (Inactive), Cheng Zhang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: