Forum Discussion

raptop's avatar
raptop
New Contributor
7 years ago

POI getCell() with missing cell policy returning null pointer exception

Hello,

I am trying to create a groovy script to read from an excel sheet using Apache poi.

To handle null pointer exceptions when calling getCell(), i am calling it with the MissingCellPolicy CREATE_NULL_AS_BLANK, however, it is still triggering a null pointer exception.

 

I have attached a screenshot of my code. Any assistance to help resolve this issue would be appreciated.

  • Although i didn't get a response, i found a work around i thought i would share.

    I think the issue is that, although it doesn't throw an error, the getCell MissingCellPolicy isn't fully supported by the compiler SOAPUI OS uses.

    I used a combination of using the MissingCellPolicy and exception handling via nested try/catch statements to be able to achieve what i needed.

  • raptop's avatar
    raptop
    New Contributor

    Although i didn't get a response, i found a work around i thought i would share.

    I think the issue is that, although it doesn't throw an error, the getCell MissingCellPolicy isn't fully supported by the compiler SOAPUI OS uses.

    I used a combination of using the MissingCellPolicy and exception handling via nested try/catch statements to be able to achieve what i needed.