ClassCastException and IndexOutOfBoundException

34 views
Skip to first unread message

NamNVH

unread,
Aug 9, 2018, 5:37:25 AM8/9/18
to Payara Forum
1. Create a custom component
@FacesComponent(createTag = true, tagName = "inputHidden", namespace = "http://mytaglib/tags", value = "myInputHidden")
public class MyInputHidden extends HtmlInputHidden implements Serializable {


   
private static final long serialVersionUID = 5173135479509877319L;

   
@Override
   
public Object getSubmittedValue() {
       
if (super.getSubmittedValue() == null && !isValid() && MyCommonTag.considerEmptyStringNull(FacesContext.getCurrentInstance())) {
           
return "";
       
} else {
           
return super.getSubmittedValue();
       
}
   
}


}

2. Use it on xhtml
<my:inputHidden value="#{MyController.backFlg}"/>
MyController is @Viewscoped.

3. Environment
Payara server 163
JDK Version: 1.8.0_112
Hazelcast enabled
10 Application servers.

4. Problem
I noticed that in server.log, these two exceptions appeared many times:
  • javax.faces.FacesException: Unexpected error restoring state for component with id products:j_idt1352.  Cause: java.lang.ClassCastException: com.sun.faces.facelets.el.TagMethodExpression cannot be cast to [Ljava.lang.Object;."
  • javax.faces.FacesException: Unexpected error restoring state for component with id j_idt30.  Cause: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0."

5. Question
Is there any relation between the above code and these 2 exceptions?
If not, is there any cause for these exceptions?
It's a great help if you can show me how to reproduce these exceptions since they seem to appear randomly.

Ondro Mihályi

unread,
Aug 9, 2018, 10:23:49 AM8/9/18
to NamNVH, Payara Forum
Hi,

Have you tried the same code with the latest Payara 4.1.2.181 and/or Payara 5.182? If it's a bug it might be already fixed.

Ondro

--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/5fee9866-b1df-4273-84e0-b6bdf2f18e09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages