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

Solution In Progress - Updated -


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(
    at org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.buildResources(
    at org.drools.compiler.kie.builder.impl.AbstractKieModule.buildKnowledgePackages(
    at org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(
    at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(


  • 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