Bug 995436 - NPE when entry-point is not set for InsertObjectCommand
NPE when entry-point is not set for InsertObjectCommand
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: jBPM Core (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ER4
: 6.0.0
Assigned To: Kris Verlaenen
Ivo Bek
Depends On:
  Show dependency treegraph
Reported: 2013-08-09 07:16 EDT by Ivo Bek
Modified: 2014-08-06 16:12 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-08-06 16:12:13 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ivo Bek 2013-08-09 07:16:41 EDT
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();
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 );
BatchExecutionCommand command = CommandFactory.newBatchExecution(cmds, "ksession1");

Below is the stacktrace of NPE.

	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:

Actual results:

Expected results:

Additional info:
Comment 1 Kris Verlaenen 2013-08-22 19:39:25 EDT
Comment 2 Ivo Bek 2013-09-23 06:46:46 EDT
Seems that the method newInsert sets null endpoint:

getCommandFactoryProvider().newInsert( object,outIdentifier,true, null );

So, the change didn't helped.

Then I propose to change the setEntryPoint method to prevent set null entry point.

Here is the pull request I propose https://github.com/droolsjbpm/drools/pull/258 also for the other commands which use entry point.
Comment 7 Ivo Bek 2013-10-15 07:37:05 EDT
Verified in BPMS 6.0.0.ER4

Note You need to log in before you can comment on or make changes to this bug.