Bug 735123 - Cannot load BRL resource via changeset of KnowledgeAgent
Summary: Cannot load BRL resource via changeset of KnowledgeAgent
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: BRMS 5.2.0.GA
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: ---
Assignee: Tihomir Surdilovic
QA Contact: Jiri Svitak
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-01 15:01 UTC by Jiri Svitak
Modified: 2015-06-02 01:34 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-20 11:48:33 UTC
Type: ---


Attachments (Terms of Use)
Files to reproduce bug (1.86 KB, application/zip)
2011-09-01 16:07 UTC, Jiri Svitak
no flags Details

Description Jiri Svitak 2011-09-01 15:01:49 UTC
Description of problem:
It is not possible to load BRL file resource via changeset of KnowledgeAgent, but only when you use just engine libraries. As I have discovered, you have to add gui libraries to classpath to make BRL loading via knowledge agent working. I guess that if knowledge agent is part of the engine, then it should work without gui libraries, particularly without class org.drools.ide.common.BusinessRuleProviderDefaultImpl.

Stack trace:
java.lang.RuntimeException: org.drools.compiler.DroolsParserException: java.lang.IllegalArgumentException: Unable to instantiate service for Class 'org.drools.compiler.BusinessRuleProvider'
	at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:644)
	at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
	at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:712)
	at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:1002)
	at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:785)
	at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:657)
	at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:190)
	at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:169)
	at com.sample.LoadBRL.testSimpleBRLLoad(LoadBRL.java:34)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.drools.compiler.DroolsParserException: java.lang.IllegalArgumentException: Unable to instantiate service for Class 'org.drools.compiler.BusinessRuleProvider'
	at org.drools.compiler.PackageBuilder.addPackageFromBrl(PackageBuilder.java:490)
	at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:559)
	... 31 more
Caused by: java.lang.IllegalArgumentException: Unable to instantiate service for Class 'org.drools.compiler.BusinessRuleProvider'
	at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:161)
	at org.drools.compiler.BusinessRuleProviderFactory.loadProvider(BusinessRuleProviderFactory.java:46)
	at org.drools.compiler.BusinessRuleProviderFactory.getProvider(BusinessRuleProviderFactory.java:35)
	at org.drools.compiler.PackageBuilder.addPackageFromBrl(PackageBuilder.java:468)
	... 32 more
Caused by: java.lang.IllegalArgumentException: Unable to instantiate 'org.drools.ide.common.BusinessRuleProviderDefaultImpl'
	at org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.newInstance(ServiceRegistryImpl.java:210)
	at org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.call(ServiceRegistryImpl.java:202)
	at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:159)
	... 35 more
Caused by: java.lang.ClassNotFoundException: org.drools.ide.common.BusinessRuleProviderDefaultImpl
	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:186)
	at org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.newInstance(ServiceRegistryImpl.java:207)
	... 37 more




Version-Release number of selected component (if applicable):
BRMS 5.2.0 ER3

How reproducible:
Create knowledge agent and load brl file via changeset.

Steps to Reproduce:
1. Unzip attached files.
2. Run JUnit to reproduce bug.
  
Actual results:
BRL file cannot be loaded via knowledge agent without gui libraries.

Expected results:
Knowledge agent should not depend on gui libraries.

Additional info:

Comment 1 Jiri Svitak 2011-09-01 16:07:45 UTC
Created attachment 521050 [details]
Files to reproduce bug

Comment 2 Jiri Svitak 2011-09-20 11:48:33 UTC
Missing class has been added in BRMS 5.2.0 ER4 and BRL file loading via changeset of KnowledgeAgent now works fine.


Note You need to log in before you can comment on or make changes to this bug.