[JBoss JIRA] (DROOLS-2773) NPE when creating a new KieScanner
by Raphael Bowen Giudice (JIRA)
Raphael Bowen Giudice created DROOLS-2773:
---------------------------------------------
Summary: NPE when creating a new KieScanner
Key: DROOLS-2773
URL: https://issues.jboss.org/browse/DROOLS-2773
Project: Drools
Issue Type: Bug
Components: kie server
Affects Versions: 7.8.0.Final
Reporter: Raphael Bowen Giudice
Assignee: Edson Tirelli
When creating a new *KieScanner*, a *NullPointerException* is thrown. Here's the code where the *KieScanner* is created:
{code:java}
final KieServices kieServices = KieServices.Factory.get();
final KieContainer kieContainer = kieServices.newKieContainer(
kieServices.newReleaseId("mygroup", "rules", "1.0-SNAPSHOT"));
final KieScanner kieScanner = kieServices.newKieScanner(kieContainer);
code}
The method *indexArtifacts* in the *KieRepositoryScannerImpl* class, tries to index all the Maven artefacts.In my case, the artefact *sun.jdk:jconsole:jdk* cannot be resolved, which causes the *NullPointerException* in the line 399:
{code:java}
private Map<ReleaseId, DependencyDescriptor> indexArtifacts() {
Map<ReleaseId, DependencyDescriptor> depsMap = new HashMap<ReleaseId, DependencyDescriptor>();
for (DependencyDescriptor dep : artifactResolver.getAllDependecies()) {
if ( !"test".equals(dep.getScope()) && !"provided".equals(dep.getScope()) && !"system".equals(dep.getScope()) ) {
Artifact artifact = artifactResolver.resolveArtifact(dep.getReleaseId());
log.debug( artifact + " resolved to " + artifact.getFile() ); // NPE happens here.
if (isKJar(artifact.getFile())) {
depsMap.put(adapt( dep.getReleaseIdWithoutVersion() ), new DependencyDescriptor(artifact));
}
} else {
log.debug("{} does not need to be resolved because in scope {}", dep, dep.getScope());
}
}
return depsMap;
}
{code}
The curious part is that the *sun.jdk:jconsole:jdk* artefact is not declared in any of my projects or dependencies, as far as I could investigate.
Here's the NPE stack trace:
{code}
Caused by: java.lang.NullPointerException: null
at org.kie.scanner.KieRepositoryScannerImpl.indexArtifacts(KieRepositoryScannerImpl.java:399)
at org.kie.scanner.KieRepositoryScannerImpl.setKieContainer(KieRepositoryScannerImpl.java:116)
at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieScanner(KieServicesImpl.java:227)
at com.test.ServiceConfoguration.kieContainer(ServiceConfoguration.java:84)
at com.test.ServiceConfoguration$$EnhancerBySpringCGLIB$$4fd6caf2.CGLIB$kieContainer$2(<generated>)
at com.test.ServiceConfoguration$$EnhancerBySpringCGLIB$$4fd6caf2$$FastClassBySpringCGLIB$$f73690dd.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356)
at com.test.ServiceConfoguration$$EnhancerBySpringCGLIB$$4fd6caf2.kieContainer(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 19 common frames omitted
{code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 11 months
[JBoss JIRA] (DROOLS-2513) Add support for embedded test execution
by Tibor Zimányi (JIRA)
[ https://issues.jboss.org/browse/DROOLS-2513?page=com.atlassian.jira.plugi... ]
Tibor Zimányi updated DROOLS-2513:
----------------------------------
Sprint: 2018 Week 17-18, 2018 Week 19-22, 2018 Week 23-24, 2018 Week 25-26, 2018 Week 27-29 (was: 2018 Week 17-18, 2018 Week 19-22, 2018 Week 23-24, 2018 Week 25-26, 2018 Week 27-29, 2018 Week 30-32)
> Add support for embedded test execution
> ---------------------------------------
>
> Key: DROOLS-2513
> URL: https://issues.jboss.org/browse/DROOLS-2513
> Project: Drools
> Issue Type: Enhancement
> Components: dmn engine
> Affects Versions: 7.7.0.Final
> Reporter: Edson Tirelli
> Assignee: Matteo Mortari
> Fix For: 7.10.0.Final
>
>
> TCK test cases can be embedded in the DMN model under the extension elements (e.g., see Trisotech generated models).
> Add a public API to allow execution of embedded test cases.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 11 months