Argument Error: One or more parameters are null.

I am getting"javax.servlet.jsp.JspException: Argument Error: One or more parameters are null". Following are first two lines of the exception

javax.servlet.jsp.JspException: Argument Error: One or more parameters are null.at com.sun.faces.taglib.html_basic.PanelGridTag.doEndTag(PanelGridTag.java:470)at _empEditById._jspService(_empEditById.java:290)

Can anyone help me out with this.

[412 byte] By [Jatin_Kulkarnia] at [2007-11-26 17:57:55]
# 1
Show a reproduceable code snippet causing this exception.Which JSF version are you using?
BalusCa at 2007-7-9 5:11:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

I don't know which part of jsp code is giving problem. Here is the complete listing

<f:view>

<html>

<head>

<meta http-equiv="Content-Type"

content="text/html; charset=windows-1252"/>

<title>Main</title>

</head>

<body><h:form>

<strong>Employee Edit</strong>

<h:messages/>

<h:panelGrid columns="3">

<h:outputLabel value="Employee Id:"/>

<h:inputText id="empId" disabled="true"

value="#{b_empEditById.empId}"/>

<h:panelGroup/>

<h:outputLabel value="First Name:"/>

<h:inputText id="firstName" required="true"

value="#{b_empEditById.firstName}"/>

<h:message for="firstName"/>

<h:outputLabel value="Last Name:"/>

<h:inputText id="lastName" required="true"

value="#{b_empEditById.lastName}"/>

<h:message for="lastName"/>

<h:outputLabel value="Hire Date:"/>

<h:inputText id="hireDate" value="#{b_empEditById.hireDate}">

<f:convertDateTime pattern="dd-MM-yyyy"/>

</h:inputText>

<h:message for="hireDate"/>

<h:outputLabel value="Reports To:"/>

<h:selectOneMenu id="reportsTo"

value="#{b_empEditById.reportsTo}">

<f:selectItems value="#{requestScope.b_empEditById.selectAllEmployees}"/>

</h:selectOneMenu>

<h:message for="reportsTo"/>

<h:commandButton value="Confirm" id="edit"

action="#{b_empEditById.confirm}"/>

<h:commandButton value="Back" type="submit" immediate="true"

action="back"/>

</h:panelGrid>

</h:form></body>

</html>

</f:view>

I am using Oracle jdeveloper 10g but I don't which version of JSF I am using.

Jatin_Kulkarnia at 2007-7-9 5:11:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
> I don't know which part of jsp code is giving> problem. Just cut step by step as much as possible some small parts away until the exception disappears.
BalusCa at 2007-7-9 5:11:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
I commented the complete jsp code (between f:view tags). The exception still occurs.
Jatin_Kulkarnia at 2007-7-9 5:11:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
How do I see the generated servlet code in OC4J?
Jatin_Kulkarnia at 2007-7-9 5:11:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
> I commented the complete jsp code (between f:view> tags). The exception still occurs.Do not comment it out. Cut it out.
BalusCa at 2007-7-9 5:11:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

As you said, I cut out the pieces of code one by one and have narrowed to the code snippet that is giving the error. It is h:selectOneMenu. Here is the defination of the code in jsp.

<h:selectOneMenu id="reportsTo"

value="#{b_empEditById.reportsTo}">

<f:selectItems value="#{b_empEditById.selectAllEmployees}"/>

</h:selectOneMenu>

<h:message for="reportsTo"/>

And here is the java code in backing bean.

public Integer getReportsTo(){

reportsTo = empObj.getReportsTo();

return reportsTo;

}

public void setReportsTo(Integer reportsTo){

this.reportsTo = reportsTo;

}

public List getSelectAllEmployees(){

HashMap<Integer,String> reportsToHash;

List selectItems = new ArrayList();

FacesContext ctx = FacesContext.getCurrentInstance();

Object requestObject = ctx.getApplication().getVariableResolver().

resolveVariable(ctx, "EmployeeReg");

EmployeeReg empReg = (EmployeeReg) requestObject;

reportsToHash = empReg.getReportsToHash();

if(reportsToHash == null)

System.out.println("Error in getting reportsTo Hash Map");

selectItems.add(new SelectItem(0,"none"));

for(int i = 1; i < reportsToHash.size(); i++){

selectItems.add(new SelectItem(new Integer(i),reportsToHash.get(new Integer(i))));

}

return selectItems;

}

Is there anything wrong with the code ?

Jatin_Kulkarnia at 2007-7-9 5:11:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8
I solved the problem. Actually reportsToHash was containing one null value which was not handled. Thanks BalusC for giving me the idea to narrow the problem code by cutting the pieces of code.regards,Jatin.
Jatin_Kulkarnia at 2007-7-9 5:11:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 9
Well done ;)
BalusCa at 2007-7-9 5:11:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...