]
Alejo Jara commented on DROOLS-723:
-----------------------------------
Not work if I use kiescanner in the project reproducer :(
Guice error resolving implementation for RepositorySystem in shaded
jar
-----------------------------------------------------------------------
Key: DROOLS-723
URL:
https://issues.jboss.org/browse/DROOLS-723
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 6.0.1.Final
Reporter: Salem Elrahal
Assignee: Mario Fusco
Fix For: 6.3.0.CR1
Attachments: guice-error.tar.gz
I have included drools in a shaded jar and when trying to resolve a kjar from a releaseId
I get the following exception. I have attached a simple reproducer that will show the
error. Build the project then run
{code:shell}
java -jar target/guice-error-1.0-SNAPSHOT.jar
{code}
Exception:
{code}
Exception in thread "main" java.lang.RuntimeException:
org.kie.scanner.embedder.MavenEmbedderException: com.google.inject.ProvisionException:
Guice provision errors:
1) No implementation for org.apache.maven.repository.RepositorySystem was bound.
while locating org.apache.maven.execution.DefaultMavenExecutionRequestPopulator
at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]]
at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]]
while locating org.apache.maven.execution.MavenExecutionRequestPopulator
1 error
role: org.apache.maven.execution.MavenExecutionRequestPopulator
roleHint:
at
org.kie.scanner.embedder.MavenProjectLoader.parseMavenPom(MavenProjectLoader.java:21)
at
org.kie.scanner.embedder.MavenProjectLoader.loadMavenProject(MavenProjectLoader.java:48)
at org.kie.scanner.Aether.<init>(Aether.java:44)
at org.kie.scanner.Aether.getAether(Aether.java:54)
at org.kie.scanner.MavenRepository.getMavenRepository(MavenRepository.java:45)
at org.kie.scanner.ArtifactResolver.<init>(ArtifactResolver.java:25)
at
org.kie.scanner.KieRepositoryScannerImpl.getArtifactResolver(KieRepositoryScannerImpl.java:67)
at
org.kie.scanner.KieRepositoryScannerImpl.loadArtifact(KieRepositoryScannerImpl.java:88)
at
org.kie.scanner.KieRepositoryScannerImpl.loadArtifact(KieRepositoryScannerImpl.java:83)
at
org.drools.compiler.kie.builder.impl.KieRepositoryImpl.loadKieModuleFromMavenRepo(KieRepositoryImpl.java:113)
at
org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:99)
at
org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:76)
at
org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:84)
at com.redhat.KnowledgeBaseService.getRuleBase(KnowledgeBaseService.java:28)
at com.redhat.Main.main(Main.java:11)
Caused by: org.kie.scanner.embedder.MavenEmbedderException:
com.google.inject.ProvisionException: Guice provision errors:
1) No implementation for org.apache.maven.repository.RepositorySystem was bound.
while locating org.apache.maven.execution.DefaultMavenExecutionRequestPopulator
at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]]
at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]]
while locating org.apache.maven.execution.MavenExecutionRequestPopulator
1 error
role: org.apache.maven.execution.MavenExecutionRequestPopulator
roleHint:
at org.kie.scanner.embedder.MavenEmbedder.<init>(MavenEmbedder.java:125)
at org.kie.scanner.embedder.MavenEmbedder.<init>(MavenEmbedder.java:104)
at org.kie.scanner.embedder.MavenEmbedder.<init>(MavenEmbedder.java:131)
at
org.kie.scanner.embedder.MavenProjectLoader.parseMavenPom(MavenProjectLoader.java:18)
... 14 more
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException:
com.google.inject.ProvisionException: Guice provision errors:
1) No implementation for org.apache.maven.repository.RepositorySystem was bound.
while locating org.apache.maven.execution.DefaultMavenExecutionRequestPopulator
at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]]
at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]]
while locating org.apache.maven.execution.MavenExecutionRequestPopulator
1 error
role: org.apache.maven.execution.MavenExecutionRequestPopulator
roleHint:
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:257)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:239)
at org.kie.scanner.embedder.MavenEmbedder.lookup(MavenEmbedder.java:527)
at
org.kie.scanner.embedder.MavenEmbedder.buildMavenExecutionRequest(MavenEmbedder.java:152)
at org.kie.scanner.embedder.MavenEmbedder.<init>(MavenEmbedder.java:115)
... 17 more
Caused by: com.google.inject.ProvisionException: Guice provision errors:
1) No implementation for org.apache.maven.repository.RepositorySystem was bound.
while locating org.apache.maven.execution.DefaultMavenExecutionRequestPopulator
at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]]
at ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]]
while locating org.apache.maven.execution.MavenExecutionRequestPopulator
1 error
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:974)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
... 22 more
{code}