You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Kem Elbrader (JIRA)" <de...@myfaces.apache.org> on 2007/04/26 20:15:15 UTC

[jira] Created: (TOMAHAWK-971) Schedule throws a java.lang.IllegalStateException if more than one post back is made consecitively when using the jsf 1.1 ri

Schedule throws a java.lang.IllegalStateException if more than one post back is made consecitively when using the jsf 1.1 ri
----------------------------------------------------------------------------------------------------------------------------

                 Key: TOMAHAWK-971
                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-971
             Project: MyFaces Tomahawk
          Issue Type: Bug
          Components: Schedule
    Affects Versions: 1.1.5, 1.1.6-SNAPSHOT
         Environment: Sun 1.5.0_11-b03
apache-tomcat-5.5.23
Sun jsf-1.1_02-b08
Microsoft Windows XP [Version 5.1.2600]
            Reporter: Kem Elbrader


Deploying the myfaces-example-simple-1.1.5.war on a default installation of tomcat the schedule1.jsf page works fine. Switching to the reference implementation of jsf the schedule1.jsf page comes up and I'm able to make one post back to the page but I get the following exception after more than one post back of any kind.

java.lang.IllegalStateException: org.apache.myfaces.custom.schedule.UISchedule$ScheduleActionListener
	at javax.faces.component.StateHolderSaver.restore(StateHolderSaver.java:100)
	at javax.faces.component.UIComponentBase.restoreAttachedState(UIComponentBase.java:1299)
	at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1151)
	at org.apache.myfaces.custom.schedule.UISchedule.restoreState(UISchedule.java:378)
	at org.apache.myfaces.custom.schedule.HtmlSchedule.restoreState(HtmlSchedule.java:189)
	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1032)
	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
	at com.sun.faces.application.StateManagerImpl.restoreComponentState(StateManagerImpl.java:359)
	at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:262)
	at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:250)
	at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:177)
	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
	at java.lang.Thread.run(Thread.java:595)

For example on the schedule1.jsf page click "add sample entries" twice.
To isolate that this happens on any post back I added the following to the same page

<h:form>
    <h:commandButton value="test"/>
</h:form>

and then clicked the test button twice.

I've also found the same result on the following environments.
 - apache-tomcat-5.5.23, jsf-1.1_02-b08, and tomahawk-1.1.5
 - apache-tomcat-5.5.23, jsf-1.1_02-b08, and tomahawk-1.1.6-SNAPSHOT
 - apache-tomcat-6.0.10, jsf-1.1_02-b08, and tomahawk-1.1.5
 - apache-tomcat-6.0.10, jsf-1.1_02-b08, and tomahawk-1.1.6-SNAPSHOT
 - apache-tomcat-6.0.10, jsf-1.2_04-b07-FCS, and tomahawk-1.1.5
 - apache-tomcat-6.0.10, jsf-1.2_04-b07-FCS, tomahawk-1.1.6-SNAPSHOT

the MyFaces implementation seems to work fine in all of these environments.




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-971) Schedule throws a java.lang.IllegalStateException if more than one post back is made consecitively when using the jsf 1.1 ri

Posted by "Luca Conte (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494719 ] 

Luca Conte commented on TOMAHAWK-971:
-------------------------------------

The couse is the Action's listener inner class, if I remove from org.apache.myfaces.custom.schedule.UISchedule the ActionListenere definion and its references all work.

To remove or to change for fix:
  private class ScheduleActionListener implements ActionListener
    {
        //~ Methods ------------------------------------------------------------
**/
        /**
         * @see javax.faces.event.ActionListener#processAction(javax.faces.event.ActionEvent)
         */
     public void processAction(ActionEvent event)
                throws AbortProcessingException
        {
            UISchedule schedule = (UISchedule) event.getComponent();
            ScheduleEntry entry = schedule.getSubmittedEntry();
            schedule.getModel().setSelectedEntry(entry);
            schedule.setSubmittedEntry(null);

            if (schedule.getAction() != null)
            {
                getFacesContext().getApplication().getActionListener()
                        .processAction(event);
            }
        }

> Schedule throws a java.lang.IllegalStateException if more than one post back is made consecitively when using the jsf 1.1 ri
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-971
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-971
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Schedule
>    Affects Versions: 1.1.5, 1.1.6-SNAPSHOT
>         Environment: Sun 1.5.0_11-b03
> apache-tomcat-5.5.23
> Sun jsf-1.1_02-b08
> Microsoft Windows XP [Version 5.1.2600]
>            Reporter: Kem Elbrader
>         Assigned To: Jurgen Lust
>
> Deploying the myfaces-example-simple-1.1.5.war on a default installation of tomcat the schedule1.jsf page works fine. Switching to the reference implementation of jsf the schedule1.jsf page comes up and I'm able to make one post back to the page but I get the following exception after more than one post back of any kind.
> java.lang.IllegalStateException: org.apache.myfaces.custom.schedule.UISchedule$ScheduleActionListener
> 	at javax.faces.component.StateHolderSaver.restore(StateHolderSaver.java:100)
> 	at javax.faces.component.UIComponentBase.restoreAttachedState(UIComponentBase.java:1299)
> 	at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1151)
> 	at org.apache.myfaces.custom.schedule.UISchedule.restoreState(UISchedule.java:378)
> 	at org.apache.myfaces.custom.schedule.HtmlSchedule.restoreState(HtmlSchedule.java:189)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1032)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
> 	at com.sun.faces.application.StateManagerImpl.restoreComponentState(StateManagerImpl.java:359)
> 	at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:262)
> 	at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:250)
> 	at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:177)
> 	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
> 	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
> 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
> 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
> 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
> 	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
> 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
> 	at java.lang.Thread.run(Thread.java:595)
> For example on the schedule1.jsf page click "add sample entries" twice.
> To isolate that this happens on any post back I added the following to the same page
> <h:form>
>     <h:commandButton value="test"/>
> </h:form>
> and then clicked the test button twice.
> I've also found the same result on the following environments.
>  - apache-tomcat-5.5.23, jsf-1.1_02-b08, and tomahawk-1.1.5
>  - apache-tomcat-5.5.23, jsf-1.1_02-b08, and tomahawk-1.1.6-SNAPSHOT
>  - apache-tomcat-6.0.10, jsf-1.1_02-b08, and tomahawk-1.1.5
>  - apache-tomcat-6.0.10, jsf-1.1_02-b08, and tomahawk-1.1.6-SNAPSHOT
>  - apache-tomcat-6.0.10, jsf-1.2_04-b07-FCS, and tomahawk-1.1.5
>  - apache-tomcat-6.0.10, jsf-1.2_04-b07-FCS, tomahawk-1.1.6-SNAPSHOT
> the MyFaces implementation seems to work fine in all of these environments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TOMAHAWK-971) Schedule throws a java.lang.IllegalStateException if more than one post back is made consecitively when using the jsf 1.1 ri

Posted by "Eduard Martinescu (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TOMAHAWK-971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eduard Martinescu updated TOMAHAWK-971:
---------------------------------------

    Status: Patch Available  (was: Open)

> Schedule throws a java.lang.IllegalStateException if more than one post back is made consecitively when using the jsf 1.1 ri
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-971
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-971
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Schedule
>    Affects Versions: 1.1.5, 1.1.7-SNAPSHOT
>         Environment: Sun 1.5.0_11-b03
> apache-tomcat-5.5.23
> Sun jsf-1.1_02-b08
> Microsoft Windows XP [Version 5.1.2600]
>            Reporter: Kem Elbrader
>            Assignee: Jurgen Lust
>
> Deploying the myfaces-example-simple-1.1.5.war on a default installation of tomcat the schedule1.jsf page works fine. Switching to the reference implementation of jsf the schedule1.jsf page comes up and I'm able to make one post back to the page but I get the following exception after more than one post back of any kind.
> java.lang.IllegalStateException: org.apache.myfaces.custom.schedule.UISchedule$ScheduleActionListener
> 	at javax.faces.component.StateHolderSaver.restore(StateHolderSaver.java:100)
> 	at javax.faces.component.UIComponentBase.restoreAttachedState(UIComponentBase.java:1299)
> 	at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1151)
> 	at org.apache.myfaces.custom.schedule.UISchedule.restoreState(UISchedule.java:378)
> 	at org.apache.myfaces.custom.schedule.HtmlSchedule.restoreState(HtmlSchedule.java:189)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1032)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
> 	at com.sun.faces.application.StateManagerImpl.restoreComponentState(StateManagerImpl.java:359)
> 	at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:262)
> 	at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:250)
> 	at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:177)
> 	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
> 	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
> 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
> 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
> 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
> 	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
> 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
> 	at java.lang.Thread.run(Thread.java:595)
> For example on the schedule1.jsf page click "add sample entries" twice.
> To isolate that this happens on any post back I added the following to the same page
> <h:form>
>     <h:commandButton value="test"/>
> </h:form>
> and then clicked the test button twice.
> I've also found the same result on the following environments.
>  - apache-tomcat-5.5.23, jsf-1.1_02-b08, and tomahawk-1.1.5
>  - apache-tomcat-5.5.23, jsf-1.1_02-b08, and tomahawk-1.1.6-SNAPSHOT
>  - apache-tomcat-6.0.10, jsf-1.1_02-b08, and tomahawk-1.1.5
>  - apache-tomcat-6.0.10, jsf-1.1_02-b08, and tomahawk-1.1.6-SNAPSHOT
>  - apache-tomcat-6.0.10, jsf-1.2_04-b07-FCS, and tomahawk-1.1.5
>  - apache-tomcat-6.0.10, jsf-1.2_04-b07-FCS, tomahawk-1.1.6-SNAPSHOT
> the MyFaces implementation seems to work fine in all of these environments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-971) Schedule throws a java.lang.IllegalStateException if more than one post back is made consecitively when using the jsf 1.1 ri

Posted by "Eduard Martinescu (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12495742 ] 

Eduard Martinescu commented on TOMAHAWK-971:
--------------------------------------------

The problem is NOT with the inner class.

The problem is actually with the 'restoreState()' method.

Currently, at the end of restorState, there is a call to 

addActionListener(scheduleListener); 

This duplicates work done in the constructor itself, causing 2 instance of the listener to be added.

If you make the fix suggested above, this will continue to add extra entries to the listener array list, and not be correct behavior.

The real fix is to NOT do the call above in the restoreState() method, and just let it be taken care of in the constructor.



> Schedule throws a java.lang.IllegalStateException if more than one post back is made consecitively when using the jsf 1.1 ri
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-971
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-971
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Schedule
>    Affects Versions: 1.1.5, 1.1.6-SNAPSHOT
>         Environment: Sun 1.5.0_11-b03
> apache-tomcat-5.5.23
> Sun jsf-1.1_02-b08
> Microsoft Windows XP [Version 5.1.2600]
>            Reporter: Kem Elbrader
>         Assigned To: Jurgen Lust
>
> Deploying the myfaces-example-simple-1.1.5.war on a default installation of tomcat the schedule1.jsf page works fine. Switching to the reference implementation of jsf the schedule1.jsf page comes up and I'm able to make one post back to the page but I get the following exception after more than one post back of any kind.
> java.lang.IllegalStateException: org.apache.myfaces.custom.schedule.UISchedule$ScheduleActionListener
> 	at javax.faces.component.StateHolderSaver.restore(StateHolderSaver.java:100)
> 	at javax.faces.component.UIComponentBase.restoreAttachedState(UIComponentBase.java:1299)
> 	at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1151)
> 	at org.apache.myfaces.custom.schedule.UISchedule.restoreState(UISchedule.java:378)
> 	at org.apache.myfaces.custom.schedule.HtmlSchedule.restoreState(HtmlSchedule.java:189)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1032)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
> 	at com.sun.faces.application.StateManagerImpl.restoreComponentState(StateManagerImpl.java:359)
> 	at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:262)
> 	at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:250)
> 	at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:177)
> 	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
> 	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
> 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
> 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
> 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
> 	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
> 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
> 	at java.lang.Thread.run(Thread.java:595)
> For example on the schedule1.jsf page click "add sample entries" twice.
> To isolate that this happens on any post back I added the following to the same page
> <h:form>
>     <h:commandButton value="test"/>
> </h:form>
> and then clicked the test button twice.
> I've also found the same result on the following environments.
>  - apache-tomcat-5.5.23, jsf-1.1_02-b08, and tomahawk-1.1.5
>  - apache-tomcat-5.5.23, jsf-1.1_02-b08, and tomahawk-1.1.6-SNAPSHOT
>  - apache-tomcat-6.0.10, jsf-1.1_02-b08, and tomahawk-1.1.5
>  - apache-tomcat-6.0.10, jsf-1.1_02-b08, and tomahawk-1.1.6-SNAPSHOT
>  - apache-tomcat-6.0.10, jsf-1.2_04-b07-FCS, and tomahawk-1.1.5
>  - apache-tomcat-6.0.10, jsf-1.2_04-b07-FCS, tomahawk-1.1.6-SNAPSHOT
> the MyFaces implementation seems to work fine in all of these environments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TOMAHAWK-971) Schedule throws a java.lang.IllegalStateException if more than one post back is made consecitively when using the jsf 1.1 ri

Posted by "Peter Mahoney (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TOMAHAWK-971?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Peter Mahoney updated TOMAHAWK-971:
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.7-SNAPSHOT
           Status: Resolved  (was: Patch Available)

The fix is different to the patch. MyFaces UIComponentBase assumes the action listeners are saved as part of the component state, and then restored. UISchedule removes the ScheduleActionListener before the state is saved, as it is a private class and not necessary to save. So, after super.restoreState() is called in MyFaces, there are no action listeners, so we  need to call addActionListener() again.

The simple answer is to remove the action listener before the restore, so that we know it is not already registered when addActionListener is called after the restore.

> Schedule throws a java.lang.IllegalStateException if more than one post back is made consecitively when using the jsf 1.1 ri
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-971
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-971
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Schedule
>    Affects Versions: 1.1.5, 1.1.7-SNAPSHOT
>         Environment: Sun 1.5.0_11-b03
> apache-tomcat-5.5.23
> Sun jsf-1.1_02-b08
> Microsoft Windows XP [Version 5.1.2600]
>            Reporter: Kem Elbrader
>            Assignee: Peter Mahoney
>             Fix For: 1.1.7-SNAPSHOT
>
>         Attachments: uischedule.diff
>
>
> Deploying the myfaces-example-simple-1.1.5.war on a default installation of tomcat the schedule1.jsf page works fine. Switching to the reference implementation of jsf the schedule1.jsf page comes up and I'm able to make one post back to the page but I get the following exception after more than one post back of any kind.
> java.lang.IllegalStateException: org.apache.myfaces.custom.schedule.UISchedule$ScheduleActionListener
> 	at javax.faces.component.StateHolderSaver.restore(StateHolderSaver.java:100)
> 	at javax.faces.component.UIComponentBase.restoreAttachedState(UIComponentBase.java:1299)
> 	at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1151)
> 	at org.apache.myfaces.custom.schedule.UISchedule.restoreState(UISchedule.java:378)
> 	at org.apache.myfaces.custom.schedule.HtmlSchedule.restoreState(HtmlSchedule.java:189)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1032)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
> 	at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1044)
> 	at com.sun.faces.application.StateManagerImpl.restoreComponentState(StateManagerImpl.java:359)
> 	at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:262)
> 	at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:250)
> 	at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:177)
> 	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
> 	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
> 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
> 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
> 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
> 	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
> 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
> 	at java.lang.Thread.run(Thread.java:595)
> For example on the schedule1.jsf page click "add sample entries" twice.
> To isolate that this happens on any post back I added the following to the same page
> <h:form>
>     <h:commandButton value="test"/>
> </h:form>
> and then clicked the test button twice.
> I've also found the same result on the following environments.
>  - apache-tomcat-5.5.23, jsf-1.1_02-b08, and tomahawk-1.1.5
>  - apache-tomcat-5.5.23, jsf-1.1_02-b08, and tomahawk-1.1.6-SNAPSHOT
>  - apache-tomcat-6.0.10, jsf-1.1_02-b08, and tomahawk-1.1.5
>  - apache-tomcat-6.0.10, jsf-1.1_02-b08, and tomahawk-1.1.6-SNAPSHOT
>  - apache-tomcat-6.0.10, jsf-1.2_04-b07-FCS, and tomahawk-1.1.5
>  - apache-tomcat-6.0.10, jsf-1.2_04-b07-FCS, tomahawk-1.1.6-SNAPSHOT
> the MyFaces implementation seems to work fine in all of these environments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.