0 Replies Latest reply: Mar 9, 2012 9:00 AM by leventgunay RSS

    Ajax Request Problem

    leventgunay Newbie

      Hi,

       

      We are trying to manage JSFUnit tests with our ajax requests. But it cannot complete restore view phase and does not fire decodes. Our implementation seems like following;

       

      <p:spinner id="spinnerBasic" value="#{testController.spin}">
           <p:ajax />
      </p:spinner>
      

       

       

       

      Get spin up button and click.

      clientSession.getCustomElement().spinUp();
      

       

       

       

      It is working without ajax, unfortunatelly does not work with ajax as following exception;

      java.lang.NullPointerException
                at com.sun.faces.context.PartialViewContextImpl.createPartialResponseWriter(PartialViewContextImpl.java:441)
                at com.sun.faces.context.PartialViewContextImpl.access$300(PartialViewContextImpl.java:71)
                at com.sun.faces.context.PartialViewContextImpl$DelayedInitPartialResponseWriter.getWrapped(PartialViewContextImpl.java:582)
                at com.sun.faces.context.PartialViewContextImpl.createPartialResponseWriter(PartialViewContextImpl.java:441)
                at com.sun.faces.context.PartialViewContextImpl.access$300(PartialViewContextImpl.java:71)
                at com.sun.faces.context.PartialViewContextImpl$DelayedInitPartialResponseWriter.getWrapped(PartialViewContextImpl.java:582)
                at javax.faces.context.PartialResponseWriter.startDocument(PartialResponseWriter.java:115)
                at org.primefaces.context.PrimePartialResponseWriter.startDocument(PrimePartialResponseWriter.java:205)
                at com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:199)
                at com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:123)
                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
                at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
                at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
                at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:594)
                at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:485)
                at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
                at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
                at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
                at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:972)
                at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:412)
                at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
                at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:906)
                at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
                at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
                at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
                at org.eclipse.jetty.server.Server.handle(Server.java:350)
                at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:442)
                at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:927)
                at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:784)
                at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217)
                at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:46)
                at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:545)
                at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:43)
                at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
                at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
                at java.lang.Thread.run(Thread.java:680)
      2012-03-09 15:41:42.831:INFO:oejsl.ELContextCleaner:Clazz: class org.primefaces.integration.bean.SpinnerView loaded by sun.misc.Launcher$AppClassLoader@558fe7c3
      2012-03-09 15:41:42.831:INFO:oejsl.ELContextCleaner:not removed: contextclassloader=WebAppClassLoader=223489506@d522de2clazz's classloader=sun.misc.Launcher$AppClassLoader@558fe7c3
      2012-03-09 15:41:42.831:INFO:oejsl.ELContextCleaner:javax.el.BeanELResolver purged
      2012-03-09 15:41:42.831:INFO:oejsh.ContextHandler:stopped o.j.s.j.a.ShrinkWrapWebAppContext{/primefaces-test,file:/private/var/folders/Vt/VtSD0aMOGEmmMk2OjSnH-U+++TI/-Tmp-/jetty-localhost-9090-export628449678675466760primefaces-test.war-_primefaces-test-any-/webapp/},file:/var/folders/Vt/VtSD0aMOGEmmMk2OjSnH-U+++TI/-Tmp-/export628449678675466760primefaces-test.war
      2012-03-09 15:41:42.839:WARN:oejs.ServletHandler:/primefaces-test/ArquillianServletRunner
      java.lang.IllegalStateException
                at org.eclipse.jetty.server.session.AbstractSession.checkValid(AbstractSession.java:89)
                at org.eclipse.jetty.server.session.HashedSession.checkValid(HashedSession.java:55)
                at org.eclipse.jetty.server.session.AbstractSession.setAttribute(AbstractSession.java:406)
                at org.eclipse.jetty.server.session.AbstractSession.removeAttribute(AbstractSession.java:374)
                at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:127)
                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1336)
                at org.jboss.jsfunit.arquillian.container.JSFUnitCleanupTestTreadFilter.doFilter(JSFUnitCleanupTestTreadFilter.java:51)
                at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1336)
                at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:483)
                at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
                at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
                at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
                at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:972)
                at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:412)
                at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
                at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:906)
                at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
                at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
                at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
                at org.eclipse.jetty.server.Server.handle(Server.java:350)
                at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:442)
                at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:910)
                at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:565)
                at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217)
                at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:46)
                at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:545)
                at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:43)
                at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
                at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
                at java.lang.Thread.run(Thread.java:680)
      

       

       

       

      We already looked into request handler and it seems request starts but cannot reach facescontext properly.

      Then, is there any request customization required within embedded containers (using Arquillian deployment with jetty 7) or JSFUnit faces context factory etc. ?

       

      Thanks,

       

      Levent

       

      edited by: leventgunay, wiki code parts