I have a DataTable with a <h:column> as <h:selectBooleanCheckbox>. Both the facet header and the DataTable rows content for that <h:column> are <h:selectBooleanCheckbox>. Below is the code I used:
<h:form>
<h:dataTable
value="#{employeeService.employeeList }"
var="empl"
binding="#{employeeService.dataTablebinding }">
......
......
......
<h:column>
<f:facet name="header">
<h:selectBooleanCheckbox id="chkBoxAll" value="#{empl.checked }" valueChangeListener="#{employeeService.checkAll }" onclick="submit()"></h:selectBooleanCheckbox>
</f:facet>
<h:selectBooleanCheckbox id="tableChkBox" value="#{empl.checked }" valueChangeListener="#{employeeService.getCheckChanged }" onclick="submit()"></h:selectBooleanCheckbox>
</h:column>
</h:dataTable>
</h:form>
When I click the facet header checkbox, I want all the rows checkbox to be checked and the same for unchecked also. This is the code I have for the ValueChangeListener of that facet header checkbox:
public void checkAll(ValueChangeEvent event){
for(Employee empl : employeeList){
employeeList.remove(empl);
empl.setChecked(true);
employeeList.add(empl);
}
}
I am getting the below excception:
SEVERE: AbortProcessingException thrown when processing event of type 'javax.faces.component.WrapperEvent' during phase 'PROCESS_VALIDATIONS 3' for component with ID or Client ID of 'j_id7'
27 Apr, 2013 8:20:38 PM javax.faces.component.UIViewRoot broadcastEvents
SEVERE: javax.faces.event.AbortProcessingException: java.util.ConcurrentModificationException
javax.faces.event.AbortProcessingException: java.util.ConcurrentModificationException
at javax.faces.event.MethodExpressionValueChangeListener.processValueChange(MethodExpressionValueChangeListener.java:93)
at javax.faces.event.ValueChangeEvent.processListener(ValueChangeEvent.java:134)
at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:771)
at javax.faces.component.UIData.broadcast(UIData.java:943)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:444)
at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:701)
at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:18)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:132)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:74)
at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:31)
at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
at com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16)
at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
at com.icesoft.faces.webapp.http.servlet.SessionVerifier.service(SessionVerifier.java:26)
at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
at java.util.AbstractList$Itr.next(AbstractList.java:343)
at com.infy.service.DataTableService.checkAll(DataTableService.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.el.parser.AstValue.invoke(AstValue.java:191)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at javax.faces.event.MethodExpressionValueChangeListener.processValueChange(MethodExpressionValueChangeListener.java:91)
... 33 more
Please let me know the reason for this ConcurrentModificationException.
for(Employee empl : employeeList){
empl.setChecked(true);
}
As Luigi stated, you don't need to remove the employee from the list.
It is because while looping over the list you are modifying it:
for(Employee empl : employeeList){
employeeList.remove(empl);
empl.setChecked(true);
employeeList.add(empl);
}
You need to use iterator.
for(Employee empl : employeeList){
// employeeList.remove(empl); //Not required
empl.setChecked(true);
//employeeList.add(empl); //Not required
}
Update As mentioned by Luiggi Mendoza, you don't need to remove and add the element back to the list to alter it. Just take the reference and modify it.
It's not a problem about jsf 1.2. The problem here is that you can't modify a Collection while you are iterating over it.
I think you get the same behaviour doing this:
public void checkAll(ValueChangeEvent event){
for(Employee empl : employeeList){
empl.setChecked(true);
}
}
Related
Hi can someone please help why this is giving an error when trying to display the values in a JSP page. I don't have any number been converted or String been converted to Number, however I get NumberFormatException
my Servlet getting the request to display a user record
if(action.equalsIgnoreCase("update")){
System.out.println("Came into Update");
userId=(int) Integer.parseInt(request.getParameter("userid"));
nbId=request.getParameter("nbId").trim();
System.out.println("User iD and NBid: "+ userId + nbId);
User user=new User();
user.setUser_id(userId);
user.setUser_nbk(nbId);
List userRecords=UserDAO.getUserRecord(user);
request.setAttribute("userRecords", userRecords);
List owningOrg=Owning_Org_DB.getOwningOrgRecords();
request.setAttribute("owningOrg", owningOrg);
request.getRequestDispatcher("WEB-INF/JSP/TableMaintenance/UserNewAdd.jsp").forward(request, response);
POJO:
#Entity
#Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class User {
#Id
private int user_id;
private String user_first_name;
private String user_middle_name;
private String user_last_name;
//getters and setters methos
}
DAO:
public static List getUserRecord(User obj){
Logger lo=LoggerFactory.getLogger("UserDAO.getUserRecord");
Session session= Annotationsessionfactory.getAnnotationSession();
Transaction tx=session.beginTransaction();
lo.debug("Request for A user Record");
//List<User> recList=new ArrayList<User>();
List recList=null;
try{
//String userRecord="from User";
Criteria userList=session.createCriteria(User.class)
.add(Restrictions.eq("user_nbk", obj.getUser_nbk()))
.add(Restrictions.eq("user_id", obj.getUser_id()));
recList=userList.list();
System.out.println(recList.size());
}catch (Exception e){
lo.info("Exception Occured in UserDAO.getUserRecord");
lo.debug("Exception Occured in UserDAO.getUserRecord:"+e);
tx.rollback();
}finally{
session.close();
lo.info("Session Closed in UserDAO.userRecordslist finally block: ");
}
lo.debug("Record was sent to the requesting servlet or method: "+ recList);
return recList;
}
JSP Page
<table>
<tr>
<td>First Name</td>
<td><input type="text" id="firstname" name="firstname" maxlength="80" value="">${userRecords.user_first_name}</td>
</tr>
<tr>
<td>Middle Name</td>
<td><input type="text" id="middlename" name="middlename" maxlength="80" value="${userRecords.user_middle_name}"></td>
.......
Exception I get:
SEVERE: Servlet.service() for servlet jsp threw exception
**java.lang.NumberFormatException: For input string: "user_first_name"**
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:447)
at java.lang.Integer.parseInt(Integer.java:497)
at javax.el.ListELResolver.coerce(ListELResolver.java:166)
at javax.el.ListELResolver.getValue(ListELResolver.java:51)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
at org.apache.el.parser.AstValue.getValue(AstValue.java:123)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:938)
at org.apache.jsp.WEB_002dINF.JSP.TableMaintenance.UserNewAdd_jsp._jspService (UserNewAdd_jsp.java:77)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at com.servicedbUpdate.UserUpdateDB_NewAdds.doPost(UserUpdateDB_NewAdds.java:79)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:600)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1703)
at java.lang.Thread.run(Thread.java:619)
Feb 13, 2013 10:30:49 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet UserUpdateDB_NewAdds threw exception
**java.lang.NumberFormatException: For input string: "user_first_name"**
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:447)
at java.lang.Integer.parseInt(Integer.java:497)
at javax.el.ListELResolver.coerce(ListELResolver.java:166)
at javax.el.ListELResolver.getValue(ListELResolver.java:51)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
at org.apache.el.parser.AstValue.getValue(AstValue.java:123)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:938)
at org.apache.jsp.WEB_002dINF.JSP.TableMaintenance.UserNewAdd_jsp._jspService(UserNewAdd_jsp.java:77)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:388)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at com.servicedbUpdate.UserUpdateDB_NewAdds.doPost(UserUpdateDB_NewAdds.java:79)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:600)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1703)
at java.lang.Thread.run(Thread.java:619)
The ${userRecords} here
${userRecords.user_first_name}
${userRecords.user_middle_name}
is a List<User>, however you're attempting to access it as if it's a single User. This is not valid. In EL, a List can only be accessed with an integer index, indicating the position of the list item you'd like to access, like so
${userRecords[0].user_first_name}
${userRecords[0].user_middle_name}
The exception is also basically telling that it expected an integer value instead of a string value. If you look closer at the stack trace, you'll see that a ListELResolver is involved.
However, your concrete problem is bigger. You should actually be iterating over the list. Use the JSTL <c:forEach> for that. E.g. (simplified from your odd code snippet):
<table>
<c:forEach items="${userRecords}" var="user">
<tr>
<td>${user.user_first_name}</td>
<td>${user.user_middle_name}</td>
</tr>
</c:forEach>
</table>
(note: keep the XSS attack hole in mind if you really intend to redisplay them as input values)
By the way, I'd work on your Java code conventions. Those underscores are really not Java-ish.
Well, I should create an survey application amd the value of the answers is a Long with value from 1 to 6.
I tried many different things but the result is every time:
java.lang.String cannot be cast to java.lang.Long
At the moment this my code:
java class:
...
private HashMap<Questions,Long> itemsHash= new HashMap<Questions,Long>();
private static Map<Long,Long> valutazioni;
static{
valutazioni = new LinkedHashMap<Long,Long>();
valutazioni.put(new Long("1"), new Long("1"));
valutazioni.put(new Long("2"), new Long("2"));
valutazioni.put(new Long("3"), new Long("3"));
valutazioni.put(new Long("4"), new Long("4"));
valutazioni.put(new Long("5"), new Long("5"));
valutazioni.put(new Long("6"), new Long("6"));
}
public Map getValutazioni()
{
return valutazioni;
}
...
public String prepareCreate() {
itemsHash=new HashMap<Questions,Long>();
//-- retrieve all questions from db
List<Questions> qList= getQEjb().findByQuery("select q from Question q order by q.description");
Iterator<Questions> iter=qList.iterator();
Questions q;
//--- initiliazing itemsHash with 1 as default value
while (iter.hasNext())
{
q=iter.next();
itemsHash.put(q,(new Long("1")));
}
selectedItemIndex = -1;
return "Create";
}
public String create() {
try {
List<Questions> qList= getQEjb().findByQuery("select q from Questions q order by q.description");
Iterator<Questions> iter=qList.iterator();
Questions q;
while (iter.hasNext())
{
q=iter.next();
current=new Answers();
current.setAllievo(findAllievo);
current.setData(findData);
current.setIdQuestion(q);
current.setLivello(itemsHash.get(q));
getFacade().create(current);
}
JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("ProgettiQualificaCreated"));
return pqc.prepareList();
} catch (Exception e) {
JsfUtil.addErrorMessage(e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured"));
e.printStackTrace();
return "List";
}
}
the xhtml page is:
<h:outputLabel value="#{bundle.AnswersLabel_data}" for="data" />
<h:inputText id="data" value="#{answersController.findData}" title="#{bundle.AnswersTitle_data}" >
<f:convertDateTime pattern="dd/MM/yyyy HH:mm:ss" />
</h:inputText>
<h:outputLabel value="#{bundle.AnswersLabel_allievo}" for="allievo" />
<h:inputText id="allievo" value="#{answersController.findAllievo}" title="#{bundle.AnswersTitle_allievo}" />
<h:outputLabel value="#{bundle.AnswersLabel_numScheda}" for="numScheda" />
<h:inputText id="numScheda" value="#{answersController.findNumScheda}" title="#{bundle.AnswersTitle_numScheda}" required="true" requiredMessage="#{bundle.AnswersRequiredMessage_numScheda}"/>
<h:outputText value="#{bundle.AnswersLabel_idProgetto}"/>
<h:outputText value="#{answersController.findProgetto}" title="#{bundle.AnswersTitle_idProgetto}"/>
<h:dataTable value="#{questionsController.items}" var="car" rules="all" >
<h:column>
<f:facet name="header">
<h:outputText value="#{bundle.AnswersTitle_idQuestion}"/>
</f:facet>
<h:outputText value="#{car.descrizione}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{bundle.AnswersTitle_livello}"/>
</f:facet>
<h:selectOneRadio value="#{answersController.itemsHash[car]}" title="#{bundle.AnswersTitle_idQuestion}" >
<f:selectItems value="#{answersController.getValutazioni()}" />
</h:selectOneRadio>
</h:column>
</h:dataTable>
Where is my error?
error log:
[#|2012-03-20T15:52:17.656+0100|SEVERE|glassfish3.1.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=97;_ThreadName=Thread-2;|java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long
at it.cyborg.cdg.jsfClasses.AnswersController.create(AnswersController.java:187)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.el.parser.AstValue.invoke(AstValue.java:234)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43)
at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at it.cyborg.cdg.jsfClasses.util.MultipartFilter.doFilter(MultipartFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
My application runs on Glassfish 3.1 and support JSF2.0 and PrimeFaces 3.2 RC1
The problem is that you've bound a generic Map as value of <h:selectOneRadio> as follows
<h:selectOneRadio value="#{answersController.itemsHash[car]}">
But JSF/EL doesn't support generic types. This information is namely not available during runtime. Unless you explicitly specify a converter, EL will not convert/coerce the submitted String value before setting it as Map value.
You need to explicitly specify the default JSF Long converter javax.faces.Long here:
<h:selectOneRadio value="#{answersController.itemsHash[car]}" converter="javax.faces.Long">
I am new to STRUTS and am trying to work out simple example . When I execute the example I get the following error on the internet browser..
<< javax.servlet.ServletException: javax.servlet.jsp.JspException: Exception creating bean of class com.example.LoginForm >>
and in the Eclipse console see a similar error with additional line on Null pointer exception
<< SEVERE: Error creating form bean of class com.example.LoginForm
java.lang.NullPointerException >>
Listed below is part of my struts-config.xml
struts-config.xml - Extract
<struts-config>
< form-beans>
< form-bean name="loginRequest" type="com.example.LoginForm" />
</form-bean>
< /form-beans>
< !-- =========================================== Global Forward Definitions -->
< global-forwards>
< forward
name="welcome"
path="/Welcome.do"/>
< /global-forwards>
< !-- =========================================== Action Mapping Definitions -->
< action-mappings>
< action path="/login"
name="loginRequest"
type="com.example.LoginAction">
< forward name="success"
path="/success.jsp">
< /forward>
< forward name="failure"
path="/login.jsp">
< /forward>
</action>
<action path="/Welcome"
forward="/pages/Welcome.jsp"/>
< /action-mappings>
< !-- ======================================== Message Resources Definitions -->
< message-resources parameter="MessageResources" />
< /struts-config>
My JSP login.jsp
< %# taglib prefix="bean" uri="/WEB-INF/struts-bean.tld" %>
< %# taglib prefix="html" uri="/WEB-INF/struts-html.tld" %>
< bean:message key="title" />
< html:form action="login">
<bean:message key="login.username"/>
<html:text property="username"></html:text>
<br>
<bean:message key="login.password"/>
<html:text property="password"></html:text>
<br>
<html:submit>
<bean:message key="login.submit"/>
</html:submit>
< /html:form>
The LoginForm class
package com.example;
import org.apache.struts.action.ActionForm;
public class LoginForm extends ActionForm
{
private String username;
private String password;
public LoginForm()
{
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
The LoginAction class
package com.example;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class LoginAction extends Action
{
#Override
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception
{
LoginForm login = (LoginForm)form;
String name = login.getUsername();
String pass = login.getPassword();
if(name.equals("hello") && pass.equals("hello"))
return mapping.findForward("success");
else
return mapping.findForward("failure");
}
}
The MessageResources.properties class
title=Welcome
login.username=Username
loguin.password=Password
login.submit=Submit
Stack Trace
org.apache.struts.util.RequestUtils createActionForm
SEVERE: Error creating form bean of class com.example.LoginForm
java.lang.NullPointerException
=========== ======================
at org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:289)
at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:259)
at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:213)
at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:526)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:503)
at org.apache.jsp.login_jsp._jspx_meth_html_005fform_005f0(login_jsp.java:122)
at org.apache.jsp.login_jsp._jspService(login_jsp.java:79)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
Jun 23, 2011 12:56:47 PM org.apache.struts.util.PropertyMessageResources loadLocale
WARNING: Resource org/apache/struts/taglib/html/LocalStrings_en_US.properties Not Found.
Jun 23, 2011 12:56:47 PM org.apache.struts.util.PropertyMessageResources loadLocale
WARNING: Resource org/apache/struts/taglib/html/LocalStrings_en.properties Not Found.
Jun 23, 2011 12:56:47 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception <br/><br/>
javax.servlet.jsp.JspException: Exception creating bean of class com.example.LoginForm under form name loginRequest
at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:536)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:503)
at org.apache.jsp.login_jsp._jspx_meth_html_005fform_005f0(login_jsp.java:122)
at org.apache.jsp.login_jsp._jspService(login_jsp.java:79)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
Can anyone figure out what I am doing wrong and why this error is occuring.
Thanks,
Ankit
You forgot a / in your action on html:form.
This is how you should call your action in the form.
<html:form action="/login">
Update, Make sure you clean all your XML documents including your JSP's
The following (examples) were not allowed in the XML validator:
< form-beans>
< /struts-config>
XML doesn't allow spaces inside the <></>, </> tags. This also applies to the tags too.
Update, I found the correct problem. It's your declaration for form beans in your struts-config.xml.
You have:
<form-beans>
<form-bean name="loginRequest" type="com.example.LoginForm" />
</form-bean>
</form-beans>
You're closing your <form-bean> twice.
Solution:
< form-beans>
<form-bean name="loginRequest" type="com.example.LoginForm" />
</form-beans>
Now, this must work. :-) (Sorry for the late reply, work demands me.)
Also, I suggest using an IDE such as Eclipse or NetBeans to do your Struts project (and not do this by hand-typing) especially for your XML declarations.
Check Your jsp.Its using login as action form instead of LoginForm.
Well that error is because of you have not configure you Struts-config.xml properly.
you have to give particular Form-Bean name when action of the Form is called Accordingly.
now look at you code you have give action like this.
< action path="/login" name="loginRequest" type="com.example.LoginAction">
< forward name="success" path="/success.jsp">< /forward>
but while u are calling POJO also together but you have to call that bean before you make POST action for putting any data into the user interaction.
so make one new action which can call bean class before you main action is called.
for example:
< action path="/loginPre" name="loginRequest" forward="/youloginformname.jsp">
</action>
that way problem will get solved.
I'm creating an web application, using JSF (2.0).
It has "ViewProducts.xhtml" to view Product with page. Each time this page loaded, if parameter has some thing (Eg: page=1 (ViewProduct.xhtml?page=1)), it's will automatically set the id to setPage property in that Bean.
But, i'm keeping getting this error:
Unable to create managed bean categories. The following problems were found: - Bean or property class bean.Categories for managed bean categories cannot be found.
Here is my code (Categories act like a product container):
faces-config.xml:
<faces-config version="2.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
<navigation-rule>
<from-view-id>/template/header.xhtml</from-view-id>
<navigation-case>
<from-outcome>ViewCategories</from-outcome>
<to-view-id>/ViewCategories.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<managed-bean>
<managed-bean-name>categories</managed-bean-name>
<managed-bean-class>bean.Categories</managed-bean-class>
<managed-bean-scope>view</managed-bean-scope>
</managed-bean>
ViewProducts.xhtml
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
<f:metadata>
<f:viewParam name="page" value="#{categories.page}"/>
</f:metadata>
<h:dataTable value="#{categories.listProduct}" var="cus">
<h:column>
<f:facet name="header">Name</f:facet>
<h:outputText value ="#{cus.name}"></h:outputText>
</h:column>
<h:column>
<f:facet name="header">Price</f:facet>
<h:outputText value ="#{cus.price}"></h:outputText>
</h:column>
</h:dataTable>
Categories.java (ManagedBean)
public class Categories implements Serializable {
/** Creates a new instance of categories */
public Categories() {
}
private int page = 0;
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public List<Product> listProduct = null;
public List<Product> getListProduct() {
if (listProduct != null) {
return listProduct;
} else {
listProduct = dataAccess.DataAccess.getCategories(this.page);
return listProduct;
}
}
public void setListProduct(List<Product> listProduct) {
this.listProduct = listProduct;
}
}
Stack trace:
com.sun.faces.mgbean.ManagedBeanCreationException: Unable to create managed bean categories. The following problems were found:
- Bean or property class bean.Categories for managed bean categories cannot be found.
- Bean or property class bean.Categories for managed bean categories cannot be found.
- Bean or property class bean.Categories for managed bean categories cannot be found.
- Bean or property class bean.Categories for managed bean categories cannot be found.
at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:263)
at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:86)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:69)
at org.apache.el.parser.AstValue.getValue(AstValue.java:112)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:102)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:190)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:178)
at javax.faces.component.UIData.getValue(UIData.java:554)
at javax.faces.component.UIData.getDataModel(UIData.java:1248)
at javax.faces.component.UIData.setRowIndex(UIData.java:447)
at com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:81)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:823)
at javax.faces.component.UIData.encodeBegin(UIData.java:937)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1611)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:380)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
There are at least 3 problems:
The bean class bean.Categories is not in the classpath.
You cannot have a managed property which is of a narrower scope than the managed bean.
You're duplicating the managed property with <f:viewParam>.
Ensure that the bean class is in the classpath and that you didn't typo'ed the managed bean class. You also need to get rid of the <managed-property>, you don't need it if you're already using <f:viewParam>.
Not related to the problem, but as you're already on JSF2, I'd also suggest to use annotations instead of the faces-config.xml.
I have been trying to incorporate the MultiFileUpload example from wicketstuff.org but can not find the resource for org.apache.wicket.mfu.delete. The original code can be found at the above link, and I have ommitted my code for now but can include it if it would help. The call to the missing package takes place within the renderHead() method of org.apache.wicket.markup.html.form.upload.MultiFileUploadField.java, which is read-only. I am using wicket-1.3.1.jar. I am calling the renderHead() method from org.apache.wicket.markup.html.IHeaderContributor within my code below.
Any help will be greatly appreciated.
add(new HeaderContributor(new IHeaderContributor() {
#Override
public void renderHead(IHeaderResponse response) {
response.renderOnLoadJavascript("document.getElementById('" + summaryField.getMarkupId() + "').focus()");
}
}));
and next is my call to MultiFileUploadField() where the renderHead() method that appears to be causing the problems resides.
add(new MultiFileUploadField("fileInput", new PropertyModel(this, "uploads"), 5));
and finally this is the stacktrace:
2011-02-15 10:46:25,233 [http-8080-2] DEBUG [info.jtrac.wicket.JtracApplication] - i18n failed for key: 'org.apache.wicket.mfu.delete', Class: class org.apache.wicket.markup.html.form.upload.MultiFileUploadField, Style: null, Exception: org.springframework.context.NoSuchMessageException: No message found under code 'org.apache.wicket.mfu.delete' for locale 'en'.
2011-02-15 10:46:25,233 [http-8080-2] ERROR [org.apache.wicket.RequestCycle] - Exception in rendering component: [MarkupContainer [Component id = _header_0, page = info.jtrac.wicket.ItemFormPage, path = 4:_header_0.HtmlHeaderContainer, isVisible = true, isVersioned = true]]
org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = _header_0, page = info.jtrac.wicket.ItemFormPage, path = 4:_header_0.HtmlHeaderContainer, isVisible = true, isVersioned = true]]
at org.apache.wicket.Component.renderComponent(Component.java:2497)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)
at org.apache.wicket.Component.render(Component.java:2296)
at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:222)
at org.apache.wicket.markup.resolver.HtmlHeaderResolver.resolve(HtmlHeaderResolver.java:78)
at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1267)
at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1370)
at org.apache.wicket.Page.onRender(Page.java:1446)
at org.apache.wicket.Component.render(Component.java:2296)
at org.apache.wicket.Page.renderPage(Page.java:891)
at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231)
at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1172)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.util.MissingResourceException: Unable to find resource: org.apache.wicket.mfu.delete for component: form:fileInput [class=org.apache.wicket.markup.html.form.upload.MultiFileUploadField]
at org.apache.wicket.Localizer.getString(Localizer.java:262)
at org.apache.wicket.Localizer.getString(Localizer.java:112)
at org.apache.wicket.Component.getString(Component.java:1787)
at org.apache.wicket.Component.getString(Component.java:1774)
at org.apache.wicket.markup.html.form.upload.MultiFileUploadField.renderHead(MultiFileUploadField.java:202)
at org.apache.wicket.Component.renderHead(Component.java:2532)
at org.apache.wicket.markup.html.form.FormComponentPanel.renderHead(FormComponentPanel.java:183)
at org.apache.wicket.markup.html.internal.HtmlHeaderContainer$1.component(HtmlHeaderContainer.java:212)
at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:821)
at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:836)
at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:861)
at org.apache.wicket.markup.html.internal.HtmlHeaderContainer.renderHeaderSections(HtmlHeaderContainer.java:203)
at org.apache.wicket.markup.html.internal.HtmlHeaderContainer.onComponentTagBody(HtmlHeaderContainer.java:136)
at org.apache.wicket.Component.renderComponent(Component.java:2459)
... 36 more
According to the error message there is no string defined in a .properties files for the multifileupload field's delete string.
I imagine that you need to define this one in your Application.properties (a properties file with the same name as your Application class, but with extension .properties), using the following syntax:
org.apache.wicket.mfu.delete=remove