[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Getting errors while closing a WORKPAGE using BEANMETHODINVOKER  XML
Forum Index -> Development
Author Message
phuber

Power User
[Avatar]

Joined: 06/08/2010 14:10:58
Messages: 50
Offline

Hello Bjoern

I am using the BEANMETHODINVOKER in a WORKPAGE inside a WORKPLACE. When I close (see picture) the WORKPAGE then I am receiving errors.

Do I misunderstand something?

Thank you for your help in advance
PATRICK

JSP snippet

Code:
 <t:beanprocessing id="g_1" >
 <t:beanmethodinvoker id="g_2" actionListener="#{d.GruppeBearbeitenUI.onInvokeEnd}" jsfphase="invokeEnd" />
 </t:beanprocessing>
 


JAVA snippet
Code:
   public void onInvokeEnd(ActionEvent event)
   {
   }
 


Error log snippet
Code:
 2012:02:07 13:54:06:750 | 272    | INFO     | JSF PHASE starting (end): RESTORE_VIEW 1
 2012:02:07 13:54:06:750 | 272    | INFO     | View root was directly available within session context
 2012:02:07 13:54:06:750 | 272    | INFO     | JSF PHASE ended: RESTORE_VIEW 1
 2012:02:07 13:54:06:750 | 272    | INFO     | JSF PHASE starting: APPLY_REQUEST_VALUES 2
 2012:02:07 13:54:06:750 | 272    | INFO     | JSF PHASE starting (end): APPLY_REQUEST_VALUES 2
 2012:02:07 13:54:06:750 | 272    | INFO     | queueing new ActionEvent (invoke(20,8,38,21,1))INVOKE_APPLICATION 5
 2012:02:07 13:54:06:765 | 272    | INFO     | processing bean method #{d.d_3.GruppeBearbeitenUI.onInvokeEnd}, phase: invokeEnd
 2012:02:07 13:54:06:765 | 272    | INFO     | Adding phase runnable (afterInvoke)
 2012:02:07 13:54:06:765 | 272    | INFO     | JSF PHASE ended: APPLY_REQUEST_VALUES 2
 2012:02:07 13:54:06:765 | 272    | INFO     | JSF PHASE starting: PROCESS_VALIDATIONS 3
 2012:02:07 13:54:06:765 | 272    | INFO     | JSF PHASE starting (end): PROCESS_VALIDATIONS 3
 2012:02:07 13:54:06:781 | 272    | INFO     | JSF PHASE ended: PROCESS_VALIDATIONS 3
 2012:02:07 13:54:06:781 | 272    | INFO     | JSF PHASE starting: UPDATE_MODEL_VALUES 4
 2012:02:07 13:54:06:781 | 272    | INFO     | JSF PHASE starting (end): UPDATE_MODEL_VALUES 4
 2012:02:07 13:54:06:781 | 272    | INFO     | JSF PHASE ended: UPDATE_MODEL_VALUES 4
 2012:02:07 13:54:06:781 | 272    | INFO     | JSF PHASE starting: INVOKE_APPLICATION 5
 2012:02:07 13:54:06:781 | 272    | INFO     | JSF PHASE starting (end): INVOKE_APPLICATION 5
 2012:02:07 13:54:06:781 | 272    | INFO     | executing ActionEvent (org.eclnt.jsfserver.elements.events.BaseActionEventInvoke) in phase INVOKE_APPLICATION 5
 2012:02:07 13:54:06:781 | 272    | INFO     | Invoking method: #{d.workpageContainer.onCloseCurrentWorkpage}
 2012:02:07 13:54:06:781 | 272    | INFO     | JSF PHASE ended: INVOKE_APPLICATION 5
 2012:02:07 13:54:06:781 | 272    | INFO     | Executing Runnable from Phase Manager, starting...
 2012:02:07 13:54:06:781 | 272    | INFO     | broadcasting invoke event for BEANMETHODINVOKER instance _I_15-g_2
 2012:02:07 13:54:06:781 | 272    | INFO     | executing ActionEvent (org.eclnt.jsfserver.elements.BaseActionEvent) in phase ANY 0
 2012:02:07 13:54:06:796 | 272    | SEVERE   | Problem occurred when resolving the class for binding key: d_3
 2012:02:07 13:54:06:796 | 272    | SEVERE   | Problem occurred when resolving the class for binding key: no class was found for the key
 2012:02:07 13:54:06:796 | 272    | WARNING  | Could not create/access managed bean for: d_3
 2012:02:07 13:54:06:796 | 272    | INFO     | Reason
 .......... Stacktrace Info ..........
 java.lang.Error: Problem occurred when resolving the class for binding key: d_3
 	at org.eclnt.jsfserver.managedbean.DefaultDispatcher.readObject(DefaultDispatcher.java:424)
 	at org.eclnt.jsfserver.managedbean.DefaultDispatcher.get(DefaultDispatcher.java:362)
 	at javax.el.MapELResolver.getValue(MapELResolver.java:52)
 	at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
 	at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
 	at org.eclnt.jsfserver.util.CCELResolver.getValue(CCELResolver.java:226)
 	at org.eclnt.jsfserver.util.StackedValueExpression.getValue(StackedValueExpression.java:231)
 	at org.eclnt.jsfserver.elements.MethodExpressionDelegator.invoke(MethodExpressionDelegator.java:89)
 	at org.eclnt.jsfserver.elements.MethodExpressionDelegator.processAction(MethodExpressionDelegator.java:209)
 	at org.eclnt.jsfserver.elements.BaseActionComponent.broadcast(BaseActionComponent.java:310)
 	at org.eclnt.jsfserver.elements.impl.BEANMETHODINVOKERComponent.invokeMethodImmediately(BEANMETHODINVOKERComponent.java:112)
 	at org.eclnt.jsfserver.elements.impl.BEANMETHODINVOKERComponent.access$0(BEANMETHODINVOKERComponent.java:107)
 	at org.eclnt.jsfserver.elements.impl.BEANMETHODINVOKERComponent$Caller.run(BEANMETHODINVOKERComponent.java:27)
 	at org.eclnt.jsfserver.elements.phases.PhaseRunnables.runAllFromList(PhaseRunnables.java:90)
 	at org.eclnt.jsfserver.elements.phases.PhaseRunnables.runAfterInvokeRunnables(PhaseRunnables.java:48)
 	at org.eclnt.jsfserver.elements.phases.EclntPhaseListener.afterPhase(EclntPhaseListener.java:90)
 	at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:189)
 	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:107)
 	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 	at org.eclnt.jsfserver.util.ThreadingFilter.doFilter(ThreadingFilter.java:284)
 	at org.eclnt.jsfserver.util.ThreadingFilter.doFilter(ThreadingFilter.java:96)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 	at org.eclnt.jsfserver.util.CompressionFilter.doFilter(CompressionFilter.java:33)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
 	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:550)
 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:380)
 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
 	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 	at java.lang.Thread.run(Unknown Source)
 2012:02:07 13:54:06:890 | 272    | WARNING  | No property value available for: Dispatcher #{d}/d_3, Error is: java.lang.Error: java.lang.Error: Problem occurred when resolving the class for binding key: d_3
 2012:02:07 13:54:06:890 | 272    | WARNING  |                                  probable complete expression is: #{d.d_3.GruppeBearbeitenUI} (this epxression is only correct in a single-user server scenario)
 2012:02:07 13:54:06:890 | 272    | INFO     | Invoking method: #{d.d_3.GruppeBearbeitenUI.onInvokeEnd}
 2012:02:07 13:54:06:890 | 272    | SEVERE   | Problem occurred when resolving the class for binding key: d_3
 2012:02:07 13:54:06:890 | 272    | SEVERE   | Problem occurred when resolving the class for binding key: no class was found for the key
 2012:02:07 13:54:06:890 | 272    | WARNING  | Could not create/access managed bean for: d_3
 2012:02:07 13:54:06:890 | 272    | INFO     | Reason
 .......... Stacktrace Info ..........
 java.lang.Error: Problem occurred when resolving the class for binding key: d_3
 	at org.eclnt.jsfserver.managedbean.DefaultDispatcher.readObject(DefaultDispatcher.java:424)
 	at org.eclnt.jsfserver.managedbean.DefaultDispatcher.get(DefaultDispatcher.java:362)
 	at javax.el.MapELResolver.getValue(MapELResolver.java:52)
 	at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
 	at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
 	at org.eclnt.jsfserver.util.CCELResolver.getValue(CCELResolver.java:226)
 	at org.eclnt.jsfserver.util.StackedValueExpression.getValue(StackedValueExpression.java:231)
 	at org.eclnt.jsfserver.util.StackedMethodExpression.invoke(StackedMethodExpression.java:58)
 	at org.eclnt.jsfserver.elements.MethodExpressionDelegator.invoke(MethodExpressionDelegator.java:114)
 	at org.eclnt.jsfserver.elements.MethodExpressionDelegator.processAction(MethodExpressionDelegator.java:209)
 	at org.eclnt.jsfserver.elements.BaseActionComponent.broadcast(BaseActionComponent.java:310)
 	at org.eclnt.jsfserver.elements.impl.BEANMETHODINVOKERComponent.invokeMethodImmediately(BEANMETHODINVOKERComponent.java:112)
 	at org.eclnt.jsfserver.elements.impl.BEANMETHODINVOKERComponent.access$0(BEANMETHODINVOKERComponent.java:107)
 	at org.eclnt.jsfserver.elements.impl.BEANMETHODINVOKERComponent$Caller.run(BEANMETHODINVOKERComponent.java:27)
 	at org.eclnt.jsfserver.elements.phases.PhaseRunnables.runAllFromList(PhaseRunnables.java:90)
 	at org.eclnt.jsfserver.elements.phases.PhaseRunnables.runAfterInvokeRunnables(PhaseRunnables.java:48)
 	at org.eclnt.jsfserver.elements.phases.EclntPhaseListener.afterPhase(EclntPhaseListener.java:90)
 	at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:189)
 	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:107)
 	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 	at org.eclnt.jsfserver.util.ThreadingFilter.doFilter(ThreadingFilter.java:284)
 	at org.eclnt.jsfserver.util.ThreadingFilter.doFilter(ThreadingFilter.java:96)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 	at org.eclnt.jsfserver.util.CompressionFilter.doFilter(CompressionFilter.java:33)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
 	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:550)
 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:380)
 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
 	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 	at java.lang.Thread.run(Unknown Source)
 2012:02:07 13:54:06:984 | 272    | WARNING  | No property value available for: Dispatcher #{d}/d_3, Error is: java.lang.Error: java.lang.Error: Problem occurred when resolving the class for binding key: d_3
 2012:02:07 13:54:06:984 | 272    | WARNING  |                                  probable complete expression is: #{d.d_3.GruppeBearbeitenUI} (this epxression is only correct in a single-user server scenario)
 2012:02:07 13:54:06:984 | 272    | SEVERE   | Object for execution of method "onInvokeEnd" is null. ValueBinding is: #{d.d_3.GruppeBearbeitenUI}
 2012:02:07 13:54:06:984 | 272    | SEVERE   | Method "onInvokeEnd" is not executed as consequence.
 2012:02:07 13:54:06:984 | 272    | INFO     | Executing Runnable from Phase Manager, ...finished!
 2012:02:07 13:54:06:984 | 272    | INFO     | JSF PHASE starting: RENDER_RESPONSE 6
 2012:02:07 13:54:06:984 | 272    | INFO     | JSF PHASE starting (end): RENDER_RESPONSE 6
 2012:02:07 13:54:06:999 | 272    | INFO     | ROWINCLUDE - encoding sub components: /workplace_ZZZZZ_1328617618095.jsp//null//null
 2012:02:07 13:54:06:999 | 272    | INFO     | ROWINCLUDE - encoding sub components: /workplacenavigation.jsp//null//null
 2012:02:07 13:54:06:999 | 272    | INFO     | ROWINCLUDE - encoding sub components: /eclntjsfserver/includes/wp_workpagecontainer.jsp//#{OBJECTBINDING:#{d.workpageContainer;BORDER:#C0C0C0A0;PADDING:1;ANIMATIONTYPE:foglight;ANIMATESTEPCOUNT:6;DROPRECEIVE://null
 2012:02:07 13:54:06:999 | 272    | INFO     | ROWINCLUDE component tree is built:  /CPDD:  /CP: null
 2012:02:07 13:54:07:015 | 272    | INFO     | ROWINCLUDE - encoding sub components: //null//null
 2012:02:07 13:54:07:015 | 272    | INFO     | ROWINCLUDE - encoding sub components: /eclntjsfserver/includes/wp_workpageselector.jsp//#{OBJECTBINDING:#{d.workpageContainer//null
 2012:02:07 13:54:07:015 | 272    | INFO     | Setting property: tabbedLine/ value: org.eclnt.jsfserver.elements.impl.TABBEDLINEComponent@19cabcf
 2012:02:07 13:54:07:015 | 272    | INFO     | Setting: finished
 2012:02:07 13:54:07:015 | 272    | INFO     | ROWINCLUDE - encoding sub components: /eclntjsfserver/includes/modalpopup.jsp//null//null
 2012:02:07 13:54:07:015 | 272    | INFO     | Setting property: popupNode/ value: org.eclnt.jsfserver.elements.impl.DUMMYComponent@1cf1a2b
 2012:02:07 13:54:07:031 | 272    | INFO     | Setting: finished
 2012:02:07 13:54:07:031 | 272    | INFO     | View root was stored in session context
 2012:02:07 13:54:07:031 | 272    | INFO     | JSF PHASE ended: RENDER_RESPONSE 6
 2012:02:07 13:54:07:031 | 272    | INFO     | <<<<<<<<<< request processed [281] ---------------------------------------------
 2012:02:07 13:54:07:031 | 272    | INFO     |            consumedNanosGet: 0 ms  (nanos: 0, callCount: 0)
 2012:02:07 13:54:07:031 | 272    | INFO     | Re-setting session attributes - begin
 2012:02:07 13:54:07:031 | 272    | INFO     | Re-setting session attributes - end
 
[Thumb - 2-close_view.png]
 Filename 2-close_view.png [Disk] Download
 Description
 Filesize 25 Kbytes
 Downloaded:  402 time(s)

mreich

Power User
[Avatar]

Joined: 30/01/2009 08:34:23
Messages: 750
Offline

Hi Patrick,

what is your intention, do you want to react on the close workpage event?
Maybe there's another way to realize that?

regards
Markus
[WWW]
phuber

Power User
[Avatar]

Joined: 06/08/2010 14:10:58
Messages: 50
Offline

Servus Markus

I have no intension. I already got my stuff that I expected from the invoker method. In practice my method looks like this and works fine...

Code:
   /**
    * Show hidden form again
    * 
    * @param event
    */
   public void onInvokeEnd(ActionEvent event)
   {
     if (getWorkpageContainer().getCurrentWorkpage() != null)
     {
       m_shownAfterHiddenWorkpageId = getWorkpageContainer()
       .getCurrentWorkpage().getId();
       if (m_fieldEditedOrValueChanged)
       {
         getWorkpageContainer().switchToWorkpage(
         getWorkpageContainer().getWorkpageForId(getPageName()));
       }
     }
   }


Also all my defined WorkpageDefaultLifecycleListeners are working fine. What I would like to say is: If a BEANMETHODINVOKER is defined in a JSP and when I close my WORKPAGE then I get errors.

But maybe you are right, if there exists a way to avoid using any BEANMETHODINVOKER would be great.

Prehistory:

I have a WorkpageDefaultLifecycleListener with an overridden reactOnHiddenInContentArea() method defined.

Scenario:

1. One WORKPLACE with many WORKPAGES is open (see picture again).
2. The user switches to a different WORKPAGE than the already active one (lets name this PREV-WORKPAGE).
3. Desired WORKPAGE got visible and reactOnHiddenInContentArea() was kicked off.
4. reactOnHiddenInContentArea() should tell the user that he first must complete things in PREV-WORKPAGE before switching to another WORKPAGE.
4.1. reactOnHiddenInContentArea() should switch back to PREV-WORKPAGE.

To achieve step 4.1 I had to use the BEANMETHODINVOKER which runs onInvokeEnd() after reactOnHiddenInContentArea(). Trying to do the step 4.1 direct in reactOnHiddenInContentArea() will not work.

Hopefully you can help

Thanks and with best regards
PATRICK
mreich

Power User
[Avatar]

Joined: 30/01/2009 08:34:23
Messages: 750
Offline

Hi,

sorry for the delayed feedback. I understand your intention, I'll try to reproduce your scenario and look for a possible workaround

regards
Markus
[WWW]
phuber

Power User
[Avatar]

Joined: 06/08/2010 14:10:58
Messages: 50
Offline

Good morning Markus

Thanks in advance. If you need additional information, please ask.

With best regards
PATRICK

PS: Priority = low
mreich

Power User
[Avatar]

Joined: 30/01/2009 08:34:23
Messages: 750
Offline

Hi,

a possible workaround could be, to implement the listener in the managed bean to react explicitly on the close event, in the close event you make your checks if data is persisted and consistence.

Maybe you have to introduce a kind of dirty flag, which shows the state of the data. Every data manipulation (setters) set the flag to true, save method clears the flag!

When switching or closing you check the dirty flag?

Markus
[WWW]
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team