Bug 995436

Summary: NPE when entry-point is not set for InsertObjectCommand
Product: [Retired] JBoss BPMS Platform 6 Reporter: Ivo Bek <ibek>
Component: jBPM CoreAssignee: Kris Verlaenen <kverlaen>
Status: CLOSED CURRENTRELEASE QA Contact: Ivo Bek <ibek>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: atangrin, rzhang
Target Milestone: ER4   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:12:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ivo Bek 2013-08-09 11:16:41 UTC
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:

Comment 1 Kris Verlaenen 2013-08-22 23:39:25 UTC
http://github.com/droolsjbpm/drools/commit/a3b6a327d

Comment 2 Ivo Bek 2013-09-23 10:46:46 UTC
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 11:37:05 UTC
Verified in BPMS 6.0.0.ER4