myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard W. Smith, Jr. (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (MYFACES-3720) [restoreView/restoreState] java.lang.ClassCastException: java.util.HashMap cannot be cast to javax.faces.convert.Converter
Date Mon, 13 May 2013 21:17:16 GMT

    [ https://issues.apache.org/jira/browse/MYFACES-3720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13656387#comment-13656387
] 

Howard W. Smith, Jr. commented on MYFACES-3720:
-----------------------------------------------

Thanks for the response and spending some time with this. Please note, this is not at all
urgent or a show-stopper. I just wanted to let you know that this exception occurs, and it
seems as though I can duplicate with certain data when p:dataTable is present on 'view-only'
pages.

I do use ui:include src="#{multi-condition-EL}", but I don't use c:if or c:forEach.

I do use p:dataTable, and if I'm not mistaking, I think p:dataTable may function/behave similar
to ui:repeat, but I don't use ui:repeat anywhere in my app; I have only read about other PrimeFaces
users that use ui:repeat instead of p:dataTable (maybe for the reason of avoiding the styles/CSS/behavior
wrapping content via p:dataTable).

FYI, I removed pf_ViewOther.xhtml from the view (permanently), and I still am able to duplicate
the content. Also, FYI, the following is the contents of pf_ViewOther.xhtml:

    <ui:composition>
        
        <h:panelGrid columns="2" cellpadding="3" cellspacing="3">
            <h:outputText value="Intrastate" />
            <h:outputText value="#{pf_ordersController.getYesNoDisplay(pf_ordersController.selected.intrastate)}"/>
        </h:panelGrid>
        
        <p:panel header="Post-Trip">
            <h:panelGrid columns="2" cellpadding="5" cellspacing="5">
                <h:outputText value="Passengers" />
                <h:outputText value="#{pf_ordersController.selected.passengers}"/>
                
            </h:panelGrid>
        </p:panel>
        
        <h:panelGrid columns="4" cellpadding="5" cellspacing="5">
            <h:outputText value="Created" />
            <h:outputText value="#{pf_ordersController.selected.createdDt}" >
                <f:convertDateTime pattern="MM/dd/yyyy hh:mm:ss a" />
            </h:outputText>

            <h:outputText value="Changed" />
            <h:outputText value="#{pf_ordersController.selected.changedDt}" >
                <f:convertDateTime pattern="MM/dd/yyyy hh:mm:ss a" />
            </h:outputText>
            
        </h:panelGrid>
        
    </ui:composition>

FYI, respectively, the data types of the data/components above are as follows:

intrastate - char(1)
passengers - smallint (or short)
createdDt - temporal.timestamp (or java.util.date)
changedDt - temporal.timestamp (or java.util.date)

Please note, /orders/pf_ViewAll.xhtml 'always' renders, successfully, when user clicks commandLink
or commandButton, but this exception 'only' occurs with certain records/rows/data...'only'
when I/user press F5 key on keyboard (or click browser's Refresh button/option)...after the
xhtml page has already been rendered successfully 'after' user clicked commandLink/commandButton.

Users do not ever use F5 key, but since I sometimes use F5 key in/during my testing, sometimes,
I have been experiencing this exception with certain data/rows.

I searched google for the exception, and I found the following:

http://forums.netbeans.org/topic19072.html
http://www.crazysquirrel.com/computing/java/jsf/converters.jspx

but this exception occurs on pages where I am 'not' using h:selectOneMenu (or p:selectOneMenu).
I think p:dataTable 'may' be using java.util.HashMap in it's implementation, but I have not
taken a look at PrimeFaces source code yet.

                
> [restoreView/restoreState] java.lang.ClassCastException: java.util.HashMap cannot be
cast to javax.faces.convert.Converter
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-3720
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3720
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.1.10, 2.1.11
>         Environment: 1. TomEE 1.6.0 snapshot (2013-04-29) which includes MyFaces 2.1.11
> 2. PrimeFaces 3.5 and PrimeFaces 4.0 snapshot
>            Reporter: Howard W. Smith, Jr.
>   Original Estimate: 28h
>  Remaining Estimate: 28h
>
> Originally reported as OmniFaces issue # 167 (please take a look at this, as I attached
some files there in OmniFaces issue tracker)
> https://code.google.com/p/omnifaces/issues/detail?id=167
> OmniFaces response was the following:
> Project Member #3 balusc
> This problem is indeed not related to o:enableRestorableView. The only occurrence in
the stack trace is just the delegation to super (i.e. the process continues less or more as
if the o:enableRestorableView was never involved):
>     UIViewRoot restoredView = super.restoreView(context, viewId);
> Below is stack trace with TomEE 1.6.0 (2013-04-29), myFaces 2.1.11, and PrimeFaces 4.0
snapshot. Is this a MyFaces bug or user error?
> May 09, 2013 8:06:54 AM org.apache.catalina.core.StandardWrapperValve invoke
> SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/mcmsweb]
threw exception [Error restoring component: ordersViewForm:orderViewTabView:j_id_b_1_4q_1]
with root cause
> java.lang.ClassCastException: java.util.HashMap cannot be cast to javax.faces.convert.Converter
> 	at javax.faces.component.UIOutput.restoreState(UIOutput.java:248)
> 	at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:687)
> 	at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:706)
> 	at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:706)
> 	at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:706)
> 	at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:706)
> 	at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:706)
> 	at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:706)
> 	at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:706)
> 	at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:706)
> 	at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:706)
> 	at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:706)
> 	at org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreView(DefaultFaceletsStateManagementStrategy.java:340)
> 	at org.apache.myfaces.application.StateManagerImpl.restoreView(StateManagerImpl.java:129)
> 	at org.apache.myfaces.shared.view.ViewDeclarationLanguageBase.restoreView(ViewDeclarationLanguageBase.java:106)
> 	at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.restoreView(FaceletViewDeclarationLanguage.java:2118)
> 	at org.apache.myfaces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:300)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:83)
> 	at org.omnifaces.viewhandler.RestorableViewHandler.restoreView(RestorableViewHandler.java:66)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:83)
> 	at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:127)
> 	at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
> 	at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
> 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> 	at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> 	at org.omnifaces.filter.GzipResponseFilter.doFilter(GzipResponseFilter.java:148)
> 	at org.omnifaces.filter.HttpFilter.doFilter(HttpFilter.java:75)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> 	at pf.LoginFilter.doFilter(LoginFilter.java:244)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
> 	at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
> 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
> 	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
> 	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
> 	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
> 	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1686)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 	at java.lang.Thread.run(Thread.java:722)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message