NullPointerException during creating KieBase if using "KieClasspathContainer" and xsd type resource is present

Solution In Progress - Updated -

Issue

When using the code below to get KieBase, if using KieClasspathContainer and there is .xsd type resource present in the classpath, NullPointerException will be thrown.

    KieServices ks = KieServices.Factory.get();
    KieContainer kContainer = ks.getKieClasspathContainer();
    KieBase kBase = kContainer.getKieBase("kbase");
    ......

The exception stacktrace looks like:

Exception in thread "main" java.lang.NullPointerException
    at org.drools.compiler.compiler.PackageBuilder.addPackageFromXSD(PackageBuilder.java:823)
    at org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.buildResources(CompositeKnowledgeBuilderImpl.java:209)
    at org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:86)
    at org.drools.compiler.kie.builder.impl.AbstractKieModule.buildKnowledgePackages(AbstractKieModule.java:219)
    at org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:387)
    at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:347)
......

Environment

  • Red Hat JBoss BPM Suite
    • 6.0.x
  • Red Hat JBoss BRMS
    • 6.0.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content