Uploaded image for project: 'JBoss ESB'
  1. JBoss ESB
  2. JBESB-3593

Access rules in Guvnor with authentication don't work with enableBasicAuthentication in properties file

    Details

    • Steps to Reproduce:
      Hide

      Do this:

      • Create a rule in Guvnor.
      • Check authentication is enabled on Guvnor.
      • Build the rule package and obtain the PKG url for that build.
      • From a JBoss ESB service, execute the rule with the Business rule Processor something like this:

      <action class="org.jboss.soa.esb.actions.BusinessRulesProcessor" name="GuvnorTest">
      <property name="ruleAgentProperties" value="/brmsdeployedrules.properties"/>
      <property name="object-paths">
      <object-path esb="body.Cat"/>
      </property>
      </action>

      If the brmsdeployedrules.properties is like this:

      newInstance=True
      url=http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/com.kaf.tests/LATEST
      name=guvnorAgent
      enableBasicAuthentication=True
      username=admin
      password=admin

      -Then execute the service, and throw a java.io.IOException with message of erro 401:

      21:26:01,758 ERROR [LogAgentEventListener] Agent [guvnorAgent] Message [KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage ]
      java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage
      at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:664)
      at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:889)
      at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:704)
      at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:584)
      at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:185)
      at org.jboss.internal.soa.esb.services.rules.DroolsRuleBaseHelper.createRuleAgent(DroolsRuleBaseHelper.java:228)
      at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.getRuleBaseStateForRuleAgent(DroolsRuleService.java:332)
      at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.executeStatelessRulesFromRuleAgent(DroolsRuleService.java:115)
      at org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeStateless(RuleServiceCallHelper.java:278)
      at org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeRulesService(RuleServiceCallHelper.java:262)
      at org.jboss.soa.esb.actions.BusinessRulesProcessor.executeRulesService(BusinessRulesProcessor.java:140)
      at org.jboss.soa.esb.actions.BusinessRulesProcessor.process(BusinessRulesProcessor.java:121)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:649)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:603)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:433)
      at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:540)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:680)
      Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/com.kaf.tests/LATEST
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
      at org.drools.io.impl.UrlResource.grabStream(UrlResource.java:210)
      at org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:146)
      at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:652)
      ... 18 more
      21:26:01,760 ERROR [LogAgentEventListener] Agent [guvnorAgent] Message [KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage ]
      java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage
      at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:914)
      at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:704)
      at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:584)
      at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:185)
      at org.jboss.internal.soa.esb.services.rules.DroolsRuleBaseHelper.createRuleAgent(DroolsRuleBaseHelper.java:228)
      at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.getRuleBaseStateForRuleAgent(DroolsRuleService.java:332)
      at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.executeStatelessRulesFromRuleAgent(DroolsRuleService.java:115)
      at org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeStateless(RuleServiceCallHelper.java:278)
      at org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeRulesService(RuleServiceCallHelper.java:262)
      at org.jboss.soa.esb.actions.BusinessRulesProcessor.executeRulesService(BusinessRulesProcessor.java:140)
      at org.jboss.soa.esb.actions.BusinessRulesProcessor.process(BusinessRulesProcessor.java:121)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:649)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:603)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:433)
      at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:540)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:680)
      Caused by: java.lang.NullPointerException
      at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:906)
      ... 17 more

      Show
      Do this: Create a rule in Guvnor. Check authentication is enabled on Guvnor. Build the rule package and obtain the PKG url for that build. From a JBoss ESB service, execute the rule with the Business rule Processor something like this: <action class="org.jboss.soa.esb.actions.BusinessRulesProcessor" name="GuvnorTest"> <property name="ruleAgentProperties" value="/brmsdeployedrules.properties"/> <property name="object-paths"> <object-path esb="body.Cat"/> </property> </action> If the brmsdeployedrules.properties is like this: newInstance=True url= http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/com.kaf.tests/LATEST name=guvnorAgent enableBasicAuthentication=True username=admin password=admin -Then execute the service, and throw a java.io.IOException with message of erro 401: 21:26:01,758 ERROR [LogAgentEventListener] Agent [guvnorAgent] Message [KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage ] java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:664) at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:889) at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:704) at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:584) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:185) at org.jboss.internal.soa.esb.services.rules.DroolsRuleBaseHelper.createRuleAgent(DroolsRuleBaseHelper.java:228) at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.getRuleBaseStateForRuleAgent(DroolsRuleService.java:332) at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.executeStatelessRulesFromRuleAgent(DroolsRuleService.java:115) at org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeStateless(RuleServiceCallHelper.java:278) at org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeRulesService(RuleServiceCallHelper.java:262) at org.jboss.soa.esb.actions.BusinessRulesProcessor.executeRulesService(BusinessRulesProcessor.java:140) at org.jboss.soa.esb.actions.BusinessRulesProcessor.process(BusinessRulesProcessor.java:121) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:649) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:603) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:433) at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:540) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/com.kaf.tests/LATEST at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436) at org.drools.io.impl.UrlResource.grabStream(UrlResource.java:210) at org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:146) at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:652) ... 18 more 21:26:01,760 ERROR [LogAgentEventListener] Agent [guvnorAgent] Message [KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage ] java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:914) at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:704) at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:584) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:185) at org.jboss.internal.soa.esb.services.rules.DroolsRuleBaseHelper.createRuleAgent(DroolsRuleBaseHelper.java:228) at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.getRuleBaseStateForRuleAgent(DroolsRuleService.java:332) at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.executeStatelessRulesFromRuleAgent(DroolsRuleService.java:115) at org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeStateless(RuleServiceCallHelper.java:278) at org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeRulesService(RuleServiceCallHelper.java:262) at org.jboss.soa.esb.actions.BusinessRulesProcessor.executeRulesService(BusinessRulesProcessor.java:140) at org.jboss.soa.esb.actions.BusinessRulesProcessor.process(BusinessRulesProcessor.java:121) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:649) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:603) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:433) at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:540) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) Caused by: java.lang.NullPointerException at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:906) ... 17 more
    • Affects:
      Compatibility/Configuration
    • Estimated Difficulty:
      Low

      Description

      When try to make a connection between Guvnor package and ESB to use the rules PKS's and use a properties file for obtain the url, username, so on; the ESB thrown a exception because the propertie "enableBasicAuthentication=true" when transformes to change-set use 'basicAuthentication="true"' not value "enabled" and not add authentication to the changeset and throw a IOException with 401 error.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                roar109 Hector Mendoza
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: