在执行buildAll并创建一个KieBase的同时,我得到了ProvisionException以下的提示。谁能解释我是否需要添加任何依赖关系来解决此异常。
2019-06-26 12:02:28,626警告请求-[主]任务-[Sisu]错误注入:org.apache.maven.repository.legacy.LegacyRepositorySystem 线:394 com.google.inject.ProvisionException:无法配置,请参见以下错误:
1)没有绑定org.eclipse.aether.RepositorySystem的实现。 在定位org.apache.maven.artifact.resolver.DefaultArtifactResolver时 在ClassRealm [maven,父级:ClassRealm [maven-parent,父级:null]]中(通过模块:org.eclipse.sisu.wire.WireModule-> org.eclipse.sisu.plexus.PlexusBindingModule) 在ClassRealm [maven,父级:ClassRealm [maven-parent,父级:null]]中(通过模块:org.eclipse.sisu.wire.WireModule-> org.eclipse.sisu.plexus.PlexusBindingModule) 定位org.apache.maven.artifact.resolver.ArtifactResolver时 在定位org.apache.maven.repository.legacy.LegacyRepositorySystem时
1个错误 在com.google.inject.internal.InjectorImpl $ 2.get(InjectorImpl.java:1025) 在com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051) 在org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48) 在com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81) 在com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53) 在com.google.inject.internal.ProviderInternalFactory $ 1.call(ProviderInternalFactory.java:65) 在com.google.inject.internal.ProvisionListenerStackCallback $ Provision.provision(ProvisionListenerStackCallback.java:115) 在com.google.inject.internal.ProvisionListenerStackCallback $ Provision.provision(ProvisionListenerStackCallback.java:133) 在com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68) 在com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63) 在com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45) 在com.google.inject.internal.ProviderToInternalFactoryAdapter $ 1.call(ProviderToInternalFactoryAdapter.java:46) 在com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103) 在com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) 在com.google.inject.internal.SingletonScope $ 1.get(SingletonScope.java:145) 在com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41) 在com.google.inject.internal.InjectorImpl $ 2 $ 1.call(InjectorImpl.java:1016) 在com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103) 在com.google.inject.internal.InjectorImpl $ 2.get(InjectorImpl.java:1012) 在org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:82) 在org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51) 在org.eclipse.sisu.plexus.PlexusRequirements $ RequirementProvider.get(PlexusRequirements.java:250) 在org.eclipse.sisu.plexus.ProvidedPropertyBinding.injectProperty(ProvidedPropertyBinding.java:48) 在org.eclipse.sisu.bean.BeanInjector.injectMembers(BeanInjector.java:52) 在com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:140) 在com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114) 在com.google.inject.internal.ConstructorInjector.access $ 000(ConstructorInjector.java:32) 在com.google.inject.internal.ConstructorInjector $ 1.call(ConstructorInjector.java:89) 在com.google.inject.internal.ProvisionListenerStackCallback $ Provision.provision(ProvisionListenerStackCallback.java:115) 在com.google.inject.internal.ProvisionListenerStackCallback $ Provision.provision(ProvisionListenerStackCallback.java:133) 在com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68) 在com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:87) 在com.google.inject.internal.ConstructorBindingImpl $ Factory.get(ConstructorBindingImpl.java:267) com.google.inject.internal.InjectorImpl $ 2 $ 1.call(InjectorImpl.java:1016)
我正在使用带有guice-4.0和guava 16.0.1的Drools 6.2.0 Final版本。
KieFileSystem kFile = kService.newKieFileSystem();
List<Rules> rulesList= getRules();
int i = 0;
for (Rules rule: rulesList) {
byte[] drlRuleData = rule.getData();
Resource resource = kService.getResources().newReaderResource(new
StringReader(new String(drlRuleData)));
resource.setResourceType(ResourceType.DRL);
i++;
resource.setSourcePath("rule" + i);
resource.setTargetPath("rule" + i);
kFile.write(resource);
}
KieBuilder kbuilder = kService.newKieBuilder(kFile).buildAll();