0 Replies Latest reply on May 14, 2003 12:18 PM by tschlemmer

    NullPointerException when accessing a NULL field in CMP?

    tschlemmer

      Something I recently noticed with Oracle 9.20 and JBoss 3.0.7 is that I'm getting NullPointerExceptions from abstract getxxx() methods on an entity bean. I looked at the database row associated with the entity bean and it looks like the column in question was not populated with any data and was NULL.

      I guess I would have assumed that I'd simply get a null reference back and not get an exception down in the CMP code when a DB column is null. I've only seen this on some rows of data that were created outside of the CMP mechanism. In our system some rows of data are created by other external processes and those processes are only populating those columns that have a "NOT NULL" constraint on them.

      Thanks,

      Anthony