<div dir="ltr">Hey Guys, I am having a drools compilation error when declaring an error.<div><br></div><div style>I tried to isolate this as much as possible.</div><div style><br></div><div style><a href="https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java#L43">https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java#L43</a><br>
</div><div style><br></div><div style>I just added after the given line, this:</div><div style><div>header = header + &quot; declare Message\n &quot;+</div><div>        <span class="" style="white-space:pre">                </span>&quot; @role(event) \n &quot; +</div>
<div>        <span class="" style="white-space:pre">                </span> &quot; end \n &quot;;</div><div><br></div><div style>And I get this exception:</div><div style><div>java.lang.NullPointerException</div><div><span class="" style="white-space:pre">        </span>at java.io.FilterOutputStream.write(FilterOutputStream.java:97)</div>
<div><span class="" style="white-space:pre">        </span>at org.drools.compiler.compiler.io.memory.MemoryFileSystem.writeJarEntries(MemoryFileSystem.java:437)</div><div><span class="" style="white-space:pre">        </span>at org.drools.compiler.compiler.io.memory.MemoryFileSystem.writeJarEntries(MemoryFileSystem.java:430)</div>
<div><span class="" style="white-space:pre">        </span>at org.drools.compiler.compiler.io.memory.MemoryFileSystem.writeJarEntries(MemoryFileSystem.java:430)</div><div><span class="" style="white-space:pre">        </span>at org.drools.compiler.compiler.io.memory.MemoryFileSystem.writeJarEntries(MemoryFileSystem.java:430)</div>
<div><span class="" style="white-space:pre">        </span>at org.drools.compiler.compiler.io.memory.MemoryFileSystem.zip(MemoryFileSystem.java:387)</div><div><span class="" style="white-space:pre">        </span>at org.drools.compiler.compiler.io.memory.MemoryFileSystem.writeAsBytes(MemoryFileSystem.java:365)</div>
<div><span class="" style="white-space:pre">        </span>at org.drools.compiler.kie.builder.impl.MemoryKieModule.getBytes(MemoryKieModule.java:64)</div><div><span class="" style="white-space:pre">        </span>at org.drools.compiler.CommonTestMethodBase.createKJar(CommonTestMethodBase.java:421)</div>
<div><span class="" style="white-space:pre">        </span>at org.drools.compiler.integrationtests.IncrementalCompilationTest.createAndDeployJar(IncrementalCompilationTest.java:205)</div><div><span class="" style="white-space:pre">        </span>at org.drools.compiler.integrationtests.IncrementalCompilationTest.testLoadOrderAfterRuleRemoval(IncrementalCompilationTest.java:70)</div>
<div><span class="" style="white-space:pre">        </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</div><div><span class="" style="white-space:pre">        </span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)</div>
<div><span class="" style="white-space:pre">        </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</div><div><span class="" style="white-space:pre">        </span>at java.lang.reflect.Method.invoke(Method.java:601)</div>
<div><span class="" style="white-space:pre">        </span>at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)</div><div><span class="" style="white-space:pre">        </span>at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)</div>
<div><span class="" style="white-space:pre">        </span>at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)</div><div><span class="" style="white-space:pre">        </span>at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)</div>
<div><span class="" style="white-space:pre">        </span>at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)</div><div><span class="" style="white-space:pre">        </span>at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)</div>
<div><span class="" style="white-space:pre">        </span>at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)</div><div><span class="" style="white-space:pre">        </span>at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)</div>
<div><span class="" style="white-space:pre">        </span>at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)</div><div><span class="" style="white-space:pre">        </span>at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)</div>
<div><span class="" style="white-space:pre">        </span>at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)</div><div><span class="" style="white-space:pre">        </span>at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)</div>
<div><span class="" style="white-space:pre">        </span>at org.junit.runners.ParentRunner.run(ParentRunner.java:309)</div><div><span class="" style="white-space:pre">        </span>at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)</div>
<div><span class="" style="white-space:pre">        </span>at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)</div><div><span class="" style="white-space:pre">        </span>at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)</div>
<div><span class="" style="white-space:pre">        </span>at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)</div><div><span class="" style="white-space:pre">        </span>at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)</div>
<div><span class="" style="white-space:pre">        </span>at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)</div><div><br></div><div style>Any idea on how to declare an event on the drl?</div>
<div style><br></div><div style>Thanks!</div><div style><br></div><div style>Demian</div></div></div></div>