Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-723

Guice error resolving implementation for RepositorySystem in shaded jar

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.3.0.CR1
    • 6.0.1.Final
    • core engine
    • None

      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

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
       java -jar target/guice-error-1.0-SNAPSHOT.jar
      

      Exception:

      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
      

              mfusco@redhat.com Mario Fusco
              selrahal Salem Elrahal (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: