Not even providing a
    DecisionTableConfiguration dtConf = KnowledgeBuilderFactory.newDecisionTableConfiguration();
in the call to
    kBuilder.add( resource, resourceType, dtConf );
fixes this; you actually have to provide a value for the DecisionTableInputType although XLS is a very reasonable default!

   dtConf.setInputType( DecisionTableInputType.XLS );

Filing a JIRA now.
-W



On 28 April 2011 15:47, Wolfgang Laun <wolfgang.laun@gmail.com> wrote:
After pull from upstreammaster and mvn.

This used to work not so long ago; easy to follow:

KnowledgeBuilderImpl:

   public void add(Resource resource, ResourceType type) {
       pkgBuilder.addKnowledgeResource( resource, type, null )  ;
// Note the null!
   }

PackageBuilder:

               DecisionTableConfiguration dtableConfiguration =
(DecisionTableConfiguration) configuration;

               String string =
DecisionTableFactory.loadFromInputStream( resource.getInputStream(),

  dtableConfiguration );    // the null thing!

DecisionTableFactory:

   public static String loadFromInputStream(InputStream is,
DecisionTableConfiguration configuration) {

       return getDecisionTableProvider().loadFromInputStream( is,
configuration );     // the null thing!
   }


DecisionTableProviderImpl:

  public String loadFromInputStream(InputStream is,
                                     DecisionTableConfiguration
configuration) {

       return compileStream( is,
                             configuration );    // the null thing!
   }

   private String compileStream(InputStream is,
                                DecisionTableConfiguration configuration) {
       SpreadsheetCompiler compiler = new SpreadsheetCompiler();
       switch ( configuration.getInputType() ) {
                          // NPE

Exception in thread "main" java.lang.NullPointerException
       at org.drools.decisiontable.DecisionTableProviderImpl.compileStream(DecisionTableProviderImpl.java:26)
       at org.drools.decisiontable.DecisionTableProviderImpl.loadFromInputStream(DecisionTableProviderImpl.java:19)
       at org.drools.compiler.DecisionTableFactory.loadFromInputStream(DecisionTableFactory.java:18)
       at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:497)
       at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
       at rss.drools.setup.Application.setup(Application.java:47)


-W