Not sure why I am getting java.lang.NullPointerException
<p>I have no idea how this is happening.  Last night it worked fine:</p>

<p>My logger on the server reads:</p>

<p>Form Array length  2</p>

<p>Fields= 2</p>

<p>so why am I getting a null if there is a size and length > 1 in the array and list??????</p>

<p>Please help...thanx</p>

<p>Form:</p>

<pre><code>  public String[] getFields() 
{ 
    return fields; 
}
public void setFields(String[] s) 
{ 
    fields = s; 
    System.out.println("Form Array length " + s.length);    
}
</code></pre>

<p>Handler:</p>

<pre><code> String[] formFields = form.getFields(); 


        List&lt;DetFieldBean&gt; fields = new ArrayList&lt;DetFieldBean&gt;();
        for( String fName : formFields )
        {
            fields.add( BeanCache.fetchFromCache(DetFieldBean.class,fName) );
        }
        System.out.println("Fields= " + fields.size() );


 for( DetFieldBean field : fields ) 
        {
           System.out.println("Field Name = " + field.getFieldName() );  &lt;&lt;-- NULL ERROR HERE???
        }
</code></pre>

<p>BEAN:</p>

<pre><code>public class DetFieldBean
extends AbstractBean
implements BeanCache.CacheableBean
{
private String fieldName;
private String displayName;
private String groupName;

public DetFieldBean() { } 

public String getFieldName() { return this.fieldName; }
public String getDisplayName() { return this.displayName; }
public String getGroupName() { return this.groupName; }

public void setFieldName( String val ) { this.fieldName = val; }
public void setDisplayName( String val ) { this.displayName = val; }
public void setGroupName( String val ) { this.groupName = val; }

public String getKey() { return this.getFieldName(); }

/**
 * Required to be a CacheableBean.  Always returns true.
 */
public boolean isActive () { return true; } 

public void readExternal( ObjectInput oIn )
    throws ClassNotFoundException, IOException
{
    this.setFieldName( oIn.readUTF() ); 
    this.setDisplayName( oIn.readUTF() );
    this.setGroupName( oIn.readUTF() );
}

public void writeExternal( ObjectOutput oOut )
    throws IOException
{
    oOut.writeUTF( this.getFieldName() );
    oOut.writeUTF( this.getDisplayName() );
    oOut.writeUTF( this.getGroupName() );
}

public void readSQL( SQLInput sIn, String typeName )
    throws SQLException
{
    sIn.readLong(); // eat the long (cause this is "under bean")
    this.setFieldName( sIn.readString() );
    this.setDisplayName( sIn.readString() );
    this.setGroupName( sIn.readString() );
}

public void writeSQL( SQLOutput sOut )
    throws SQLException
{
    sOut.writeLong(0L); // eat the long (cause this is "under bean")
    sOut.writeString( this.getFieldName() );
    sOut.writeString( this.getDisplayName() );
    sOut.writeString( this.getGroupName() );
}
</code></pre>

<p>}</p>
