Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: NPE when using MS Excel Input with filename from previous step

  1. #1
    Join Date
    Dec 2015
    Posts
    2

    Default NPE when using MS Excel Input with filename from previous step

    I'm new to Pentaho, so it's entirely possible that I'm doing something wrong. That said, I've run into a NullPointerException when using the MS Excel Input step in a transformation and I was hoping to get some help.

    I'm using PDI version 6.0.1.0-386 on a Win10 machine running JDK 1.8.0_66.

    I'm ultimately trying to build an ETL process that will all process XLSX files that it finds in a "inbox" directory. While processing, it moves them to a "Processing" folder. When done, it moves them to a "Processed" folder. The processing itself involves loading the Excel file, doing some simple data transformations, and then writing the results to a table in Postgres.

    I've structured this using a Kettle Job that gets a list of files in the directory and then feeds those to a Kettle Transformation that does the actual processing and file moving. This design requires the Excel Input step to get the filename from a previous step, which seems to trigger the problem. Whenever I set that "Accept filenames from previous steps" checkbox, I get an NPE when I try to run it. FWIW, if I change the Excel Input step to list the filename in the step config, that works just fine, but that doesn't work with the structure I've described above (i.e. the Job providing the filenames to the Transformation).

    I managed to recreate the error using a super simple transformation with just two steps, a Generate Rows step, which creates a single row with a filename constant, and the Excel Input step, which is set to use the input filename as the source file. The filename is somefile.xlsx, which is intentionally bogus, but the result is the same regardless of whether the file exists.

    I have attached the test transformation. Again, this is just a test designed to showcase the error I am seeing in my actual ETL structure.

    Test XLSX Filename Input.ktr

    Thanks in advance for any help!

    -Scot


    FWIW, the relevant part of the log is:

    Code:
    2015/12/23 17:30:50 - Test XLSX Filename Input - Dispatching started for transformation [Test XLSX Filename Input]
    2015/12/23 17:30:50 - Generate Rows.0 - Finished processing (I=0, O=0, R=0, W=1, U=0, E=0)
    2015/12/23 17:30:50 - Microsoft Excel Input.0 - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : Unexpected error
    2015/12/23 17:30:50 - Microsoft Excel Input.0 - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : java.lang.NullPointerException
    2015/12/23 17:30:50 - Microsoft Excel Input.0 -     at org.pentaho.metaverse.analyzer.kettle.step.excelinput.ExcelInputExternalResourceConsumer.getResourcesFromRow(ExcelInputExternalResourceConsumer.java:97)
    2015/12/23 17:30:50 - Microsoft Excel Input.0 -     at org.pentaho.metaverse.analyzer.kettle.step.excelinput.ExcelInputExternalResourceConsumer.getResourcesFromRow(ExcelInputExternalResourceConsumer.java:45)
    2015/12/23 17:30:50 - Microsoft Excel Input.0 -     at Proxyce5a3b28_93c7_4276_928b_520d31e242f3.getResourcesFromRow(Unknown Source)
    2015/12/23 17:30:50 - Microsoft Excel Input.0 -     at Proxyce5a3b28_93c7_4276_928b_520d31e242f3.getResourcesFromRow(Unknown Source)
    2015/12/23 17:30:50 - Microsoft Excel Input.0 -     at org.pentaho.metaverse.analyzer.kettle.extensionpoints.trans.step.StepExternalConsumerRowListener.rowReadEvent(StepExternalConsumerRowListener.java:63)
    2015/12/23 17:30:50 - Microsoft Excel Input.0 -     at org.pentaho.di.trans.step.BaseStep.getRowFrom(BaseStep.java:2171)
    2015/12/23 17:30:50 - Microsoft Excel Input.0 -     at org.pentaho.di.trans.steps.excelinput.ExcelInput.processRow(ExcelInput.java:372)
    2015/12/23 17:30:50 - Microsoft Excel Input.0 -     at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
    2015/12/23 17:30:50 - Microsoft Excel Input.0 -     at java.lang.Thread.run(Unknown Source)
    2015/12/23 17:30:50 - Microsoft Excel Input.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)
    2015/12/23 17:30:50 - Test XLSX Filename Input - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : Errors detected!
    2015/12/23 17:30:50 - Spoon - The transformation has finished!!
    2015/12/23 17:30:50 - Test XLSX Filename Input - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : Errors detected!
    2015/12/23 17:30:51 - Test XLSX Filename Input - ERROR (version 6.0.1.0-386, build 1 from 2015-12-03 11.37.25 by buildguy) : Errors detected!
    2015/12/23 17:30:51 - Test XLSX Filename Input - Transformation detected one or more steps with errors.
    2015/12/23 17:30:51 - Test XLSX Filename Input - Transformation is killing the other steps!

  2. #2
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    You're not going to like this answer...

    I got an IO error instead of a NPE when I don't have somefile.xlsx with PDI 5.4 on Win7, Java configured for 1.7
    I get success if somefile.xlsx exists.

  3. #3
    Join Date
    Dec 2015
    Posts
    2

    Default

    Quote Originally Posted by gutlez View Post
    You're not going to like this answer...

    I got an IO error instead of a NPE when I don't have somefile.xlsx with PDI 5.4 on Win7, Java configured for 1.7
    I get success if somefile.xlsx exists.
    Haha. You're right, but I appreciate the info. That's honestly what I'd expect if everything was working normally. FWIW, I had someone else try with the same PDI version and they got the NPE as well. It appears this might just be a bug with the latest version.

    Anyone have any suggestions?

    Thanks!

  4. #4
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    Try it with 5.4?

  5. #5
    Join Date
    Mar 2016
    Posts
    1

    Default

    I am having the same problem on version 6.0.1.0. There must be a bug report created on JIRA at least.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.