0 Replies Latest reply on Dec 8, 2011 7:20 PM by Tony Huynh

    HtmlDropSupport + Component Binding = IllegalStateException?

    Tony Huynh Newbie

      Hi, is the first time I've had to ask a question, so lets hope I don't muck this up

       

      I've run into a problem.  I've set up a page with an a4j:outputPanel bound to HtmlAjaxOutputPanel in my backing bean.  Like so:

       

      {code:xml}

      <a4j:outputPanel id="workSpace" layout="block" style="text-align:center;">

                          <a4j:outputPanel  binding="#{ReportDesignerBean.workSpace}"></a4j:outputPanel>

      </a4j:outputPanel>

      {code:xml}

       

      The HtmlAjaxOutputPanel is created thus:

       

      {code}

      HtmlAjaxOutputPanel dropTarget = new HtmlAjaxOutputPanel();

      dropTarget.setStyleClass("dropTarget");

      dropTarget.getAttributes().put("layout", "block");

      dropTarget.setStyle("height:"+(int)(report.getPageHeight()/4)+"px;width:"+(int)(report.getPageHeight()/4)+"px;margin:3px;position:absolute;top:"+y+"");

      dropTarget.setId("lowerDropTarget");

                     

      HtmlDropSupport dropSupport = new HtmlDropSupport();

      dropSupport.setAcceptedTypes("component");

      dropSupport.setReRender("workSpace");

      dropSupport.setId("dropArea");

             

      dropSupport.addDropListener(new MethodExpressionDropListener(BeanUtil.createMethodExpression("#{ReportDesignerBean.addComponent}", null, new Class[]{DropEvent.class})));

      dropTarget.getChildren().add(dropSupport);

                     

      workSpace = dropTarget;

      {code}

       

       

      The page displays correctly, but when a drop event occurs, via dropping a valid object onto the panel:

       

      18:04:09,155 ERROR [lifecycle] JSF1054: (Phase ID: INVOKE_APPLICATION 5, View ID: /jsp/reportDesigner/reportDesigner.jsp) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@17fb9aa]

      18:04:09,155 ERROR [BaseXMLFilter] Exception in the filter chain

      javax.servlet.ServletException

          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

          at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

          at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

          at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at cnphi.apps.cews.servlets.FullAuthCheckFilter.doFilter(FullAuthCheckFilter.java:78)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at cnphi.apps.cews.servlets.AuthorizationFilter.doFilter(AuthorizationFilter.java:203)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at cnphi.apps.cews.servlets.SessionFilter.doFilter(SessionFilter.java:102)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)

          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)

          at java.lang.Thread.run(Thread.java:619)

      Caused by: java.lang.IllegalStateException

          at javax.faces.component.UIComponentBase.queueEvent(UIComponentBase.java:997)

          at javax.faces.component.UICommand.queueEvent(UICommand.java:409)

          at org.ajax4jsf.component.AjaxActionComponent.queueEvent(AjaxActionComponent.java:120)

          at org.richfaces.component.UIDropSupport.queueEvent(UIDropSupport.java:80)

          at javax.faces.event.FacesEvent.queue(FacesEvent.java:130)

          at org.richfaces.component.UIDropSupport.broadcast(UIDropSupport.java:65)

          at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329)

          at org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304)

          at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261)

          at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474)

          at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)

          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)

          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)

          ... 33 more

      18:04:09,155 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception

      java.lang.IllegalStateException

          at javax.faces.component.UIComponentBase.queueEvent(UIComponentBase.java:997)

          at javax.faces.component.UICommand.queueEvent(UICommand.java:409)

          at org.ajax4jsf.component.AjaxActionComponent.queueEvent(AjaxActionComponent.java:120)

          at org.richfaces.component.UIDropSupport.queueEvent(UIDropSupport.java:80)

          at javax.faces.event.FacesEvent.queue(FacesEvent.java:130)

          at org.richfaces.component.UIDropSupport.broadcast(UIDropSupport.java:65)

          at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329)

          at org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304)

          at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261)

          at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474)

          at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)

          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)

          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

          at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

          at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

          at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at cnphi.apps.cews.servlets.FullAuthCheckFilter.doFilter(FullAuthCheckFilter.java:78)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at cnphi.apps.cews.servlets.AuthorizationFilter.doFilter(AuthorizationFilter.java:203)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at cnphi.apps.cews.servlets.SessionFilter.doFilter(SessionFilter.java:102)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)

          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)

          at java.lang.Thread.run(Thread.java:619)

       

      From what I've garnered from UIComponent base- during queueEvent in the HtmlAjaxOutputPanel, an attempt to get the parent component result in a null pointer error.  I've ran into a few other problems getting the Drop Listener object up to snuff, but now I'm stuck at this point.  If anyone can advise, I'd much appriciate it.

       

      Also this is under RichFaces 3.3.3 Final, if that helps.