You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "giovanardi@devandcom.it" <gi...@devandcom.it> on 2007/07/12 20:09:39 UTC

my faces and scheduler component

Hi everybody,

I have a project with a standard MyFaces implementation. I
added a scheduler component that I found here:

http://www.irian.at/myfaces/schedule5.jsf

Everything works fine except of the click event on the items
in the scheduler.
In the jsp I put the element and added a "mouseListener" and
an "action" property:

<t:schedule binding="#{Page1.schedule}" id="schedule1"
mouseListener="#{Page1.scheduleClicked}"
action="#{Page1.scheduleAction}" [...] />

and in the java code I placed the functions this way:

     public String scheduleAction()
    {
        System.out.println("selected entry: " +
schedule.getModel().getSelectedEntry());
        return "success";
    }

    public void scheduleClicked(ScheduleMouseEvent event)
    {
        StringBuffer buffer = new StringBuffer();
        switch (event.getEventType())
        {
        case ScheduleMouseEvent.SCHEDULE_BODY_CLICKED:
            buffer.append("schedule body was clicked: ");
            buffer.append(event.getClickedTime());
            break;
        case ScheduleMouseEvent.SCHEDULE_HEADER_CLICKED:
            buffer.append("schedule header was clicked: ");
            buffer.append(event.getClickedDate());
            break;
        case ScheduleMouseEvent.SCHEDULE_ENTRY_CLICKED:
            buffer.append("schedule entry was clicked.");
            
            break;
        default:
            buffer.append("no schedule mouse events
registered");
        }
        
       System.out.println(buffer);
    }


At runtime, Tomcat simply says "The server encountered an
internal error () that prevented it from fulfilling this
request.", in debug mode I see that the java methods are not
actually invoked - the error seems to happen before - and I
get logged the following:


GRAVE: Servlet.service() for servlet Faces Servlet threw
exception
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
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.restoreView(StateManagerImpl.java:336)
        at
com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:250)
        at
com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:310)
        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:252)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at
com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:198)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        
at java.lang.Thread.run(Thread.java:595)


Does anyone have an idea of what the problem is?
I can zip the whole project if necessary.

Thanks in advance!