Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-1405

Drools compiler throws NPE on DRL save when more than one rule extends same rule in the same package

XMLWordPrintable

    • Hide

      create a DRL test1.drl
      with the rule
      rule "test1"
      when
      then
      end

      create a second DRL test2.drl
      with two rules
      rule "test2" extends "test1"
      when
      then
      end

      rule "test3" extends "test1"
      when
      then
      end

      when saving the file - an error indicator appears in the messages, check the log and you shall see the stack trace

      Show
      create a DRL test1.drl with the rule rule "test1" when then end create a second DRL test2.drl with two rules rule "test2" extends "test1" when then end rule "test3" extends "test1" when then end when saving the file - an error indicator appears in the messages, check the log and you shall see the stack trace
    • Workaround Exists
    • Hide

      create a rule (in test2.drl) which extends the test1 rule
      and than extend all rules from it

      Show
      create a rule (in test2.drl) which extends the test1 rule and than extend all rules from it
    • NEW
    • NEW
    • 5680582

      Hi,

      I get the following error when saving a DRL file:

      2017-01-12 23:16:39,677 INFO [org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder] (EJB default - 10) Incremental build request being processed: default://master@opsc/health/src/main/resources/com/opsc/health/test2.drl (updated).
      2017-01-12 23:16:39,730 ERROR [org.kie.workbench.common.services.backend.builder.Builder] (EJB default - 10) null: java.lang.NullPointerException
      at java.util.LinkedList.addAll(LinkedList.java:408)
      at java.util.LinkedList.addAll(LinkedList.java:387)
      at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.sortRulesByDependency(KnowledgeBuilderImpl.java:1231)
      at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.compileRules(KnowledgeBuilderImpl.java:1086)
      at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.compileAllRules(KnowledgeBuilderImpl.java:989)
      at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.buildRules(CompositeKnowledgeBuilderImpl.java:264)
      at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.buildPackages(CompositeKnowledgeBuilderImpl.java:122)
      at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:105)
      at org.drools.compiler.kie.builder.impl.KieBuilderSetImpl.buildChanges(KieBuilderSetImpl.java:142)
      at org.drools.compiler.kie.builder.impl.KieBuilderSetImpl.build(KieBuilderSetImpl.java:94)
      at org.kie.workbench.common.services.backend.builder.Builder.buildIncrementally(Builder.java:539)
      at org.kie.workbench.common.services.backend.builder.Builder.addResource(Builder.java:383)
      at org.kie.workbench.common.services.backend.builder.Builder.addResource(Builder.java:324)
      at org.kie.workbench.common.services.backend.builder.Builder.updateResource(Builder.java:405)
      at org.kie.workbench.common.services.backend.builder.BuildServiceImpl.lambda$updatePackageResource$1(BuildServiceImpl.java:320)
      at org.kie.workbench.common.services.backend.builder.BuildServiceImpl.updatePackageResource(BuildServiceImpl.java:338)
      at org.kie.workbench.common.services.backend.builder.BuildServiceImpl.updatePackageResource(BuildServiceImpl.java:319)
      at org.kie.workbench.common.services.backend.builder.BuildServiceImpl$Proxy$_$$_WeldClientProxy.updatePackageResource(Unknown Source)
      at org.guvnor.common.services.builder.ResourceChangeIncrementalBuilder$4.execute(ResourceChangeIncrementalBuilder.java:267)
      at org.guvnor.common.services.builder.IncrementalBuilderExecutorManager.execute(IncrementalBuilderExecutorManager.java:77)
      at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
      at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)
      at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
      at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
      at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)
      at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
      at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.as.ejb3.component.singleton.SingletonComponentInstanceAssociationInterceptor.processInvocation(SingletonComponentInstanceAssociationInterceptor.java:53)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:263)
      at org.jboss.as.ejb3.tx.CMTTxInterceptor.notSupported(CMTTxInterceptor.java:313)
      at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:237)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:47)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.as.ejb3.deployment.processors.StartupAwaitInterceptor.processInvocation(StartupAwaitInterceptor.java:22)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
      at org.jboss.as.ejb3.concurrency.ContainerManagedConcurrencyInterceptor.processInvocation(ContainerManagedConcurrencyInterceptor.java:110)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:67)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
      at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:636)
      at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
      at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
      at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:198)
      at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.as.ejb3.component.interceptors.LogDiagnosticContextRecoveryInterceptor.processInvocation(LogDiagnosticContextRecoveryInterceptor.java:82)
      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      at org.jboss.as.ejb3.component.interceptors.AsyncFutureInterceptorFactory$1$2.runInvocation(AsyncFutureInterceptorFactory.java:104)
      at org.jboss.as.ejb3.component.interceptors.AsyncInvocationTask.run(AsyncInvocationTask.java:74)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      at org.jboss.threads.JBossThread.run(JBossThread.java:320)

              mfusco@redhat.com Mario Fusco
              gal_nitzan Gal Nitzan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: