Bug 779881 (SOA-2240)

Summary: business_ruleservice_ruleAgent Quickstart with Guvnor Repository
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: Gary Lamperillo <glamperi>
Component: ExamplesAssignee: tcunning
Status: CLOSED WONTFIX QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.0.2   
Target Milestone: ---   
Target Release: FUTURE   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-2240
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
SOA-P 5.0.2 and BRMS 5
Last Closed: 2011-12-06 22:01:26 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:

Description Gary Lamperillo 2010-08-25 21:13:34 UTC
Workaround Description: turn of DEBUG of org.jboss to debug issues.
recompile classes when issues occur, and remove etc classes from classpath.
project_key: SOA

Take the sample quickstart business_ruleservice_ruleAgent and modify it to use BRMS/Guvnor as supported in SOA-P 5 with BRMS/Drools 5. During the 'ant runtest' the console log will display an exception related to the localCacheDir location not being available, although the location is a directory. 

However, if the localCachedir property is removed from the brmsdeployedrules.properties file. It will now complain the the classes have serial ids which do not match. 

After the Serial ID issues are resolved the localCachedir property can be added back. The localCachedir error hides the real issue. In addition, these exceptions will not be discovered without full debug turned on at the log4j level. Here are the steps of the test case: 


1. Modify the brmsdeployedrules.properties file to be: newInstance=true url=http://localhost:8180/brms-console/org.drools.guvnor.Guvnor/package/insuranceconfig/LATEST localCacheDir=/tmp/ruleAgent/cache poll=30 name=insuranceconfig 

2. Add the Driver.class and Policy.class to a jar and add this to an insuranceconfig package in BRMS.

3. add the orginal.drl to BRMS 

4. ant deploy from quickstart folder business_ruleservice_ruleAgent 

5. Change log4j.xml to DEBUG level for org.jboss 

6. start server: run.sh

 7. ant runtest 

8. The following exceptions will be found in the console: 

11:44:16,190 INFO [SetupMessage] Moved the transformed driver and policy 11:44:16,191 DEBUG [ActionProcessingPipeline] executing processor 3 org.jboss.soa.esb.actions.BusinessRulesProcessor@13e47ea 11:44:16,192 DEBUG [ObjectMapper] expression=body.Driver value=org.jboss.soa.esb.services.rules.Driver@16304db 11:44:16,192 DEBUG [ObjectMapper] expression=body.Policy value=org.jboss.soa.esb.services.rules.Policy@1d3fae4 11:44:16,196 DEBUG [LifecycleResource] Creating resource using factory: org.jboss.internal.soa.esb.services.rules.DroolsRuleService$LifecycleRuleAgentFactory@1251229 with identity ID-6 11:44:16,300 INFO [LogAgentEventListener] AgentName = 'insuranceconfig' Configuring with newInstance=true, secondsToRefresh=30 11:44:16,303 DEBUG [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline org.jboss.soa.esb.actions.ActionProcessingException: RuleAgent could not get the RuleBase. The local cache dir /tmp/ruleAgent/cache is a file, not a directory. at org.jboss.soa.esb.actions.BusinessRulesProcessor.process(BusinessRulesProcessor.java:100) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:635) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:589) at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:419) at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:540) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:636) Caused by: org.jboss.internal.soa.esb.services.rules.RuleServiceException: RuleAgent could not get the RuleBase. The local cache dir /tmp/ruleAgent/cache is a file, not a directory. at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.executeStatelessRulesFromRuleAgent(DroolsRuleService.java:238) at org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeStateless(RuleServiceCallHelper.java:176) at org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeRulesService(RuleServiceCallHelper.java:160) at org.jboss.soa.esb.actions.BusinessRulesProcessor.executeRulesService(BusinessRulesProcessor.java:111) at org.jboss.soa.esb.actions.BusinessRulesProcessor.process(BusinessRulesProcessor.java:92) ... 7 more Caused by: org.drools.RuntimeDroolsException: The local cache dir /tmp/ruleAgent/cache is a file, not a directory. at org.drools.agent.URLScanner.configure(URLScanner.java:55) at org.drools.agent.RuleAgent.getProvider(RuleAgent.java:329) at org.drools.agent.RuleAgent.init(RuleAgent.java:233) at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:187) at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:169) at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:273) at org.jboss.internal.soa.esb.services.rules.DroolsRuleBaseHelper.createRuleAgent(DroolsRuleBaseHelper.java:214) at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.getRuleBaseStateForRuleAgent(DroolsRuleService.java:637) at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.executeStatelessRulesFromRuleAgent(DroolsRuleService.java:229) ... 11 more 11:44:16,328 WARN [ActionProcessingPipeline] No fault address defined for fault message! To: JMSEpr [ PortReference < <wsa:Address jms:127.0.0.1:1099#queue/quickstart_Business_Rules_RuleAgent_Request_ESB/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>, <wsa:ReferenceProperties jbossesb:java.naming.provider.url : 127.0.0.1:1099/>, <wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>, <wsa:ReferenceProperties jbossesb:destination-type : queue/>, <wsa:ReferenceProperties jbossesb:destination-name : queue/quickstart_Business_Rules_RuleAgent_Request_ESB/>, <wsa:ReferenceProperties jbossesb:specification-version : 1.1/>, <wsa:ReferenceProperties jbossesb:connection-factory : ConnectionFactory/>, <wsa:ReferenceProperties jbossesb:persistent : true/>, <wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>, <wsa:ReferenceProperties jbossesb:transacted : false/>, <wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ] MessageID: 81ec0a7e-c778-4459-91a4-aee38025f6c5 RelatesTo: jms:correlationID#81ec0a7e-c778-4459-91a4-aee38025f6c5 11:44:16,330 DEBUG [JAXRRegistryImpl] Going to query the registry for name pattern [DeadLetterService] 11:44:16,390 DEBUG [JAXRRegistryImpl] Service name: DeadLetterService 11:44:16,390 DEBUG [JAXRRegistryImpl] Description: Dead Messages can be send to this service, which is configured to store and/or notify 11:44:16,390 DEBUG [JAXRRegistryImpl] Key id: uddi:juddi.apache.org:3263d2f8-95c8-44a7-bde6-38333e01cc90 9. take localCacheDir out of the brmsdeployedrules.properties file. 

10. restart server. 

11. Error will mention serial ids now. 

12. Recompiles will solve the issue and removal of extra class jars, etc.

 Exception handling needs to be available for other than debug for this issue and improper errors are found.