Bug 1041312 - Cannot load rules from maven repository
Summary: Cannot load rules from maven repository
Keywords:
Status: MODIFIED
Alias: None
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: Rules / jBPM integration
Version: 6.0.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
: 6.1.0
Assignee: David Ward
QA Contact: Matej Melko
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-12 14:45 UTC by David Murphy
Modified: 2022-01-05 05:22 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
If the user attempts to import the rules-interview-container quick start and removes local DRL resources, they cannot load rules from the Maven repository. The users will instead encounter a NoClassDefFoundError.
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)

Description David Murphy 2013-12-12 14:45:29 UTC
Description of problem:
Starting from the rules-interview-container quickstart, I removed the local DRL resource and specified groupId, artifactId and version in the rules component in switchyard.xml. I expected the container to load the kjar from maven, but received a NoClassDefFoundError (full stack below)


How reproducible:
On Demand

Steps to Reproduce:
1. Import rules-interview-container into jbds
2. Delete kmodule.xml and Interview.drl
3. Open switchyard.xml
4. Open properties on Interview component
5. On implementation tab, specify Group ID: com.redhat.example, Artifact ID: interview, Version: 1.0.0
6. Build and deploy application to running FSW Beta

Actual results:
NoClassDefFoundError 


Expected results:
Rules resources loaded from maven repository (or a different error if they aren't present)


Additional info:
09:35:43,144 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."switchyard-quickstart-rules-interview-container.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."switchyard-quickstart-rules-interview-container.jar".SwitchYardService: Failed to start service
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
	at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
Caused by: java.lang.NoClassDefFoundError: org/sonatype/aether/collection/DependencyCollectionException
	at org.kie.scanner.ArtifactResolver.<init>(ArtifactResolver.java:25)
	at org.kie.scanner.KieRepositoryScannerImpl.getArtifactResolver(KieRepositoryScannerImpl.java:66)
	at org.kie.scanner.KieRepositoryScannerImpl.loadArtifact(KieRepositoryScannerImpl.java:87)
	at org.kie.scanner.KieRepositoryScannerImpl.loadArtifact(KieRepositoryScannerImpl.java:82)
	at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.loadKieModuleFromMavenRepo(KieRepositoryImpl.java:109)
	at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:95)
	at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:76)
	at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:82)
	at org.switchyard.component.common.knowledge.util.Containers.getContainer(Containers.java:71)
	at org.switchyard.component.common.knowledge.session.KnowledgeContainerSessionFactory.<init>(KnowledgeContainerSessionFactory.java:53)
	at org.switchyard.component.common.knowledge.session.KnowledgeSessionFactory.newSessionFactory(KnowledgeSessionFactory.java:121)
	at org.switchyard.component.common.knowledge.exchange.KnowledgeExchangeHandler.doStart(KnowledgeExchangeHandler.java:204)
	at org.switchyard.deploy.BaseServiceHandler.start(BaseServiceHandler.java:60)
	at org.switchyard.deploy.internal.Deployment.deployImplementations(Deployment.java:574)
	at org.switchyard.deploy.internal.Deployment.start(Deployment.java:144)
	at org.switchyard.as7.extension.deployment.SwitchYardDeployment.start(SwitchYardDeployment.java:101)
	at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:73)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	... 3 more
Caused by: java.lang.ClassNotFoundException: org.sonatype.aether.collection.DependencyCollectionException from [Module "org.kie:main" from local module loader @5c78bca (finder: local module finder @6faa7dbc (roots: /runtimes/fsw/jboss-eap-6.1/modules,/runtimes/fsw/jboss-eap-6.1/modules/system/layers/soa,/runtimes/fsw/jboss-eap-6.1/modules/system/layers/sramp,/runtimes/fsw/jboss-eap-6.1/modules/system/layers/base))]
	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]
	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
	at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
	... 22 more

Comment 2 Marco Rietveld 2014-10-28 15:29:42 UTC
David Ward, fyi: I ran into the same stack trace when building a part of the kie/drools/jbpm project. 

The solution for me, was to use maven 3.0.5 instead of maven 3.1.1. This is because of a custom plugin that we use in our build process and the fact that we use aether 1.0.x. 

It looks like this exception is caused because there's something depending on version later than aether 1.0.x, while the drools/jbpm (and ip-bom?) stuff uses the aether 1.0.x artifacts.

Comment 3 David Ward 2015-01-14 19:35:54 UTC
I re-tested this on EAP 6.3 + SwitchYard 2.0, and it works there, as the proper maven/aether dependencies are there now.  (Specifically, I changed the rules-interview-container QS to load a kjar containing the DRL from the local maven repository, vs. using what is in the QS itself.)  So, the issue reported here with the EAP stack trace had been fixed.

However, as noted above, trying to run the quickstart locally (JUnit test loading from local maven repository) does not work, because of the maven/aether build clashes in the local build environment.  I think that's lower priority, but if it's deemed necessary to fix, a new BZ/Jira should be opened, IMO.

Comment 5 David Virgil 2015-08-04 07:53:27 UTC
This has worked for me as well.


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