Can't instantiate class error in JSF
<p>Here is my managed Bean class,</p>

<p>public class MapBean implements Serializable {</p>

<pre><code>private MapModel polylineModel;
public MapBean() {
    createMap();
}

 public void createMap(){
    try {
        polylineModel = new DefaultMapModel();
        LatLng coord;
        String query = "select a.lan,a.lat from country;";  
        Connector conn = new Connector();
        Statement str = (Statement) conn.getConn().createStatement();
        ResultSet res = str.executeQuery(query);
        Polyline polyline1;
        polyline1 = new Polyline();
        while(res.next()){
            coord= new LatLng(Integer.parseInt(res.getString(2)), Integer.parseInt(res.getString(1))); 

            polyline1.getPaths().add(coord); 
     }
        polyline1.setStrokeWeight(10);  
        polyline1.setStrokeColor("#FF9900");  
        polyline1.setStrokeOpacity(0.7);  

        polylineModel.addOverlay(polyline1);
    } catch (SQLException ex) {
        Logger.getLogger(MapBean.class.getName()).log(Level.SEVERE, null, ex);
    }




 }
  public MapModel getPolylineModel() {  
    return polylineModel;  
}  

public void onPolylineSelect(OverlaySelectEvent event) {  
    addMessage(new FacesMessage(FacesMessage.SEVERITY_INFO, "Polyline Selected", null));  
}  

public void addMessage(FacesMessage message) {  
    FacesContext.getCurrentInstance().addMessage(null, message);  
}  
</code></pre>

<p>}
But the problem is when it is compiled it gives an error like this "Cant instantiate class: org.primefaces.examples.view.MapBean". What is the reason??</p>
