<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Getting error while working with "request" example in jBPM
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/prashanth_biomorf">prashanth Reddy Dundigal</a> in <i>jBPM Development</i> - <a href="https://community.jboss.org/message/753458#753458">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>When I run the request example, for dynamically adding the ad-hoc rule, it gives me the below error. The code is exactly the same given in example. What we need to change in order to execute it correctly. I see that it is not printing what is there in the "adhoc.drl", so obviously adhoc rule is not invoked.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I get the error at the line "ksession.getKnowledgeBase().addKnowledgePackages(kbuilder.getKnowledgePackages());"</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: unable to invoke method: org.jbpm.examples.request.Request.getId: target of method is null</p><p>          at org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:66)</p><p>          at org.mvel2.optimizers.impl.refl.nodes.VariableAccessor.getValue(VariableAccessor.java:37)</p><p>          at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)</p><p>          at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:107)</p><p>          at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)</p><p>          at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:123)</p><p>          at org.mvel2.MVEL.executeExpression(MVEL.java:930)</p><p>          at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:70)</p><p>          at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:49)</p><p>          at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:167)</p><p>          at org.drools.rule.constraint.MvelConstraint.isAllowedCachedLeft(MvelConstraint.java:136)</p><p>          at org.drools.common.SingleBetaConstraints.isAllowedCachedLeft(SingleBetaConstraints.java:130)</p><p>          at org.drools.reteoo.FromNode.updateSink(FromNode.java:473)</p><p>          at org.drools.reteoo.RuleTerminalNode.attach(RuleTerminalNode.java:344)</p><p>          at org.drools.reteoo.builder.ReteooRuleBuilder.addSubRule(ReteooRuleBuilder.java:168)</p><p>          at org.drools.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:128)</p><p>          at org.drools.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:116)</p><p>          at org.drools.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java:445)</p><p>          at org.drools.common.AbstractRuleBase.addRule(AbstractRuleBase.java:956)</p><p>          at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:627)</p><p>          at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:472)</p><p>          at org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:150)</p><p>          at org.jbpm.examples.request.RequestUI.addRules(RequestUI.java:238)</p><p>          at org.jbpm.examples.request.RequestUI.access$3(RequestUI.java:229)</p><p>          at org.jbpm.examples.request.RequestUI$4.actionPerformed(RequestUI.java:182)</p><p>          at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)</p><p>          at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)</p><p>          at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)</p><p>          at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)</p><p>          at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)</p><p>          at java.awt.Component.processMouseEvent(Component.java:6263)</p><p>          at javax.swing.JComponent.processMouseEvent(JComponent.java:3255)</p><p>          at java.awt.Component.processEvent(Component.java:6028)</p><p>          at java.awt.Container.processEvent(Container.java:2041)</p><p>          at java.awt.Component.dispatchEventImpl(Component.java:4630)</p><p>          at java.awt.Container.dispatchEventImpl(Container.java:2099)</p><p>          at java.awt.Component.dispatchEvent(Component.java:4460)</p><p>          at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)</p><p>          at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)</p><p>          at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)</p><p>          at java.awt.Container.dispatchEventImpl(Container.java:2085)</p><p>          at java.awt.Window.dispatchEventImpl(Window.java:2475)</p><p>          at java.awt.Component.dispatchEvent(Component.java:4460)</p><p>          at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)</p><p>          at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)</p><p>          at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)</p><p>          at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)</p><p>          at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)</p><p>          at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)</p><p>          at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)</p><p>Caused by: java.lang.NullPointerException</p><p>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p>          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p><p>          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p><p>          at java.lang.reflect.Method.invoke(Method.java:597)</p><p>          at org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:43)</p><p>          ... 49 more</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Can you please see it and let us know what to do.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thank you in advance,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Warmest regards,</p><p>Prashanth Reddy Dundigal</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/753458#753458">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2035">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>