NullPointerException occuring infnitely
<p>I want to display list of record from database to output text field. I'm having problem with method with brings record from database. It is causing an infinite loop as it call in constructor of managed bean class. Here is the code. </p>

<p>Constructor of managed bean class:</p>

<pre><code>public InterViewDto() throws SQLException {

        User u = getCurrentUser();
        InterviewDao d = new InterviewDao();
        List&lt;InterViewDto&gt; dao1 = d.getCall(u.getEmailAddress());
        setDto(dao1);

    }  
</code></pre>

<p>Method bringing record from database :</p>

<pre><code>public List&lt;InterViewDto&gt; getCall(String email) throws SQLException {
        System.out.print("fyc");
         List&lt;InterViewDto&gt; list = new ArrayList&lt;InterViewDto&gt;();

        String job = null;
        boolean exists = false;

        Connection c = null;
        try {

            c = openConnection();

            String query_check = "SELECT *  FROM interviewcall WHERE useremail = '"+email+"' ";
            Statement st = c.createStatement();
            ResultSet rs = st.executeQuery(query_check);

            while (rs.next()) {

                InterViewDto dto = new InterViewDto();
                dto.setDate( rs.getDate("time"));
                dto.setJobtitle( rs.getString("jobtitle"));
                dto.setJobtitle( rs.getString("useremail"));
                list.add(dto);
                System.out.print(list.get(0).getJobtitle());

            }       rs.close();

        } catch (Exception e) {
            System.out.println(e);

        } finally {
            c.close();
        }
        return list;
    }
</code></pre>
