Bonjour EJB JPA pro :)

j'ai un erreur j'arrive pas à le résoudre :

caused by: java.lang.IllegalArgumentException: An exception occurred while creating a query in EntityManager:
Exception Description: Syntax error parsing [SELECT sum(nb1xx) FROM Http h where 1=1 and h.host =:p].
[11, 16] The encapsulated expression is not a valid expression.
at org.eclipse.persistence.internal.jpa.EntityManager Impl.createQuery(EntityManagerImpl.java:1585)
at com.sun.enterprise.container.common.impl.EntityMan agerWrapper.createQuery(EntityManagerWrapper.java: 456)
dans mon abstract facade j'ai crée cette méthode :

public int findsumwithquery(String queryName, Map parameters) {

Query query = getEntityManager().createQuery(queryName);
Set<Map.Entry<String, Object>> rawParameters = parameters.entrySet();
for (Map.Entry<String, Object> entry : rawParameters) {
query.setParameter(entry.getKey(), entry.getValue());
}
return ((Number)query.getSingleResult()).intValue() ;
}

et dans mon managed bean httpController j'ai fait :

public httpController() {
}

@EJB private HttpFacade httpFacade;
private Http http;


//--------------statistiques classes de réponses par host


@PostConstruct
public void init(){
createPieModel();
}



private void createPieModel() {
pieModel = new PieChartModel();
pieModel.set("Nb1xx",getVal1());
pieModel.set("Nb2xx", getVal2());
pieModel.set("Nb3xx", getVal3());
pieModel.set("Nb4xx", getVal4());
pieModel.set("Nb5xx", getVal5());
}
private Integer val1;
private Integer val2;
private Integer val3;
private Integer val4;
private Integer val5;
private Date datedeb;
private Date datefin;
private String host_selected;

private PieChartModel pieModel;


public PieChartModel getPieModel() {
return pieModel;
}


public Integer getVal1() {
val1 = sumnb1xx();
return val1;
}

public void setVal1(Integer val1) {
this.val1 = val1;
}

public Integer getVal2() {
val2 = sumnb2xx();
return val2;
}

public void setVal2(Integer val2) {
this.val2 = val2;
}

public Integer getVal3() {
val3 = sumnb3xx();
return val3;
}

public void setVal3(Integer val3) {
this.val3 = val3;
}

public Integer getVal4() {
val4 = sumnb4xx();
return val4;
}

public void setVal4(Integer val4) {
this.val4 = val4;
}

public Integer getVal5() {
val5 = sumnb5xx();
return val5;
}

public void setVal5(Integer val5) {
this.val5 = val5;
}

public String getHost_selected() {
return host_selected;
}

public Date getDatedeb() {
return datedeb;
}

public Date getDatefin() {
return datefin;
}


public Integer sumnb1xx()

{

String where = " where 1=1 ";
Map<String,Object> filters1 = new HashMap<String, Object>();

if( getHost_selected()!= null)
{
where += " and h.datehttp > = :datedeb and h.datehttp < = :datefin";
filters1.put("datedeb", datedeb.getTime());
filters1.put("datefin", datefin.getTime());
}
where += " and h.host =:p" ;
filters1.put("p", getHost_selected());


String requete = "SELECT sum(nb1xx) FROM Http h " + where;
int sum = ( httpFacade.findsumwithquery(requete, filters1));
return sum;


}

public Integer sumnb2xx(){

String where = " where 1=1 ";
Map<String,Object> filters2 = new HashMap<String, Object>();

if( getHost_selected()!= null)
{
where += " and h.datehttp > = :datedeb and h.datehttp < = :datefin";
filters2.put("datedeb", datedeb.getTime());
filters2.put("datefin", datefin.getTime());
}
where += " and h.host =:p" ;
filters2.put("p", getHost_selected());

String requete = "SELECT sum(nb2xx) FROM Http h " + where;
int sum = ( httpFacade.findsumwithquery(requete, filters2));
return sum;


}

public Integer sumnb3xx(){

String where = " where 1=1 ";
Map<String,Object> filters3 = new HashMap<String, Object>();

if( getHost_selected()!= null)
{
where += " and h.datehttp >= :datedeb and h.datehttp < = :datefin";
filters3.put("datedeb", datedeb.getTime());
filters3.put("datefin", datefin.getTime());
}
where += " and h.host =:p" ;
filters3.put("p", getHost_selected());


String requete = "SELECT sum(nb3xx) FROM Http h " + where;
int sum = ( httpFacade.findsumwithquery(requete, filters3));
return sum;


}
public Integer sumnb4xx(){

String where = " where 1=1 ";
Map<String,Object> filters4 = new HashMap<String, Object>();

if( getHost_selected()!= null)
{
where += " and h.datehttp > = :datedebut and h.datehttp < = :datefin";
filters4.put("datedebut", datedeb.getTime());
filters4.put("datefin", datefin.getTime());
}
where += " and h.host =:p" ;
filters4.put("p", getHost_selected());


String requete = "SELECT sum(nb4xx) FROM Http h " + where;
int sum = ( httpFacade.findsumwithquery(requete, filters4));
return sum;


}
public Integer sumnb5xx(){

String where = " where 1=1 ";
Map<String,Object> filters5 = new HashMap<String, Object>();

if( getHost_selected()!= null)
{
where += " and h.datehttp >= :datedeb and h.datehttp <= :datefin";
filters5.put("datedebut", datedeb.getTime());
filters5.put("datefin", datedeb.getTime());
}
where += " and h.host =:p" ;
filters5.put("p", getHost_selected());


String requete = "SELECT sum(nb5xx) FROM Http h " + where;
int sum = ( httpFacade.findsumwithquery(requete, filters5));
return sum;


}

et dons mon .xhtml j'ai fait :
<body>
<h:form id="form">
<h:outputText value="Date début: " />
<p:calendar value="#{httpController.datedeb}" pattern="MM/dd/yyyy HH:mm:ss" />
<h:outputText value="Date fin: " />
<p:calendar value="#{httpController.datefin}" pattern="MM/dd/yyyy HH:mm:ss" />

<h:outputLabel for="hostname" value="Host name: *" />
<p:inputText id="hostname" value="#{httpController.host_selected}" required="true" label="Hostname">
<p:ajax update="sample , custom, panel" listener="#{httpController.init()}" />
</p:inputText>
<p:message for="firstname" display="icon"/>


<table border="0" width="100%" height ="100%" cellpadding="5">
<tr>
<td width="20%" valign="center" align="left"> </td>
<td width="60%" valign="center" align="center">
<h1><h:outputText style="text-align: center" value="Statistiques classes de réponses par Host" /> </h1>
</td>
<td width="20%" valign="center" align="left"></td>
<td width="60%" valign="center" align="right"></td>
<td width="60%" valign="center" align="left"></td>
</tr>
</table>

<table>
<td>
<p:pieChart id="sample" value="#{httpController.pieModel}" legendPosition="w" style="width:400px;height:300px" />
</td>

<td>
<p:pieChart id="custom" value="#{httpController.pieModel}" legendPosition="e" fill="false" showDataLabels="true"
style="width:400px;height:300px" sliceMargin="5" diameter="150" />
</td>
</table>



<p:panelGrid columns="2" id="panel">
<h:outputText value="Classe de réponse 1xx:" ></h:outputText>
<h:outputText value="#{httpController.sumnb1xx()}" />
<h:outputText value="Classe de réponse 2xx:"></h:outputText>
<h:outputText value="#{httpController.sumnb2xx()}" ></h:outputText>
<h:outputText value=" Classe de réponse 3xx:"></h:outputText>
<h:outputText value="#{httpController.sumnb3xx()}" ></h:outputText>
<h:outputText value=" Classe de réponse 4xx:"></h:outputText>
<h:outputText value="#{httpController.sumnb4xx()}" ></h:outputText>
<h:outputText value=" Classe de réponse 5xx:"></h:outputText>
<h:outputText value="#{httpController.sumnb5xx()}" ></h:outputText>
</p:panelGrid>

</h:form>


Je serais reconnaissante si tu peux m'aider de résoudre ce problème
et merci pour ton aide appréciée :)