3 Replies Latest reply on Mar 14, 2008 11:27 AM by ssilvert

    JSFUnit doesn't call my filter

    saasira

      Hi,

      I have a JSF 1.2 web-app with trinidad/tomahawk libs. In the web.xml we have our own filter which injects <script src="xxx.js" .... \> tag into the 'head' section of the html on each request. Basically we are injecting link to our javascript file to every request.

      Two Issues:

      1. When I add JSFUnit configuration to the web.xml our filter doesn't get called at all and hence the link to the .js file is not provided to the page.

      2. Until I run the TestCases the Application works fine (excluding the javascript issue). But after I run the Test Case by accessing the servlet <..\ServletTestRunner?....> the Application no longer works. It throws 500 erro and in the logs i see the following exception

      Hope to get some resolution to this issue!!

      Thanks
      Samba


      at com.ibm.ws.webcontainer.srt.SRTServletRequest$SRTServletRequestHelper.access$200(SRTServletRequest.java:2232)
      at com.ibm.ws.webcontainer.srt.SRTServletRequest.getAttribute(SRTServletRequest.java:196)
      at com.sun.faces.context.RequestMap.remove(ExternalContextImpl.java:1079)
      at com.sun.faces.context.FacesContextImpl.release(FacesContextImpl.java:378)
      at org.jboss.jsfunit.context.JSFUnitFacesContext.valueUnbound(JSFUnitFacesContext.java:201)
      at com.ibm.ws.webcontainer.httpsession.SessionData.processListeners(SessionData.java:924)
      at com.ibm.ws.webcontainer.httpsession.SessionData.removeValueGuts(SessionData.java:886)
      at com.ibm.ws.webcontainer.httpsession.SessionData.removeValue(SessionData.java:1265)
      at com.ibm.ws.webcontainer.httpsession.SessionData.removeAttribute(SessionData.java:1121)
      at com.ibm.ws.webcontainer.httpsession.HttpSessionFacade.removeAttribute(HttpSessionFacade.java:165)
      at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:127)
      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:768)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:676)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:486)
      at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
      at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
      at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
      at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
      at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)

        • 1. Re: JSFUnit doesn't call my filter
          ssilvert

          Since you are running on Websphere, you will need to look at this for a workaround:
          http://jira.jboss.com/jira/browse/JSFUNIT-68

          I don't think JSFUnit is failing to call a filter. One of the strengths that JSFUnit has over other testing tools is that it sends a real HTTP request to your real web app. Thus, it's the only white box tool I know of that calls into the exact filter chain you have set up for your running application.

          Because it is creating a real HTTP request just like your browser does, the question of whether or not a filter is called is solely determined by the application configuration.

          Stan

          • 2. Re: JSFUnit doesn't call my filter
            saasira

            We have done the workaround already but no luck.. JSFUnit testcases works fine as long as we dont have our filter and/or a seam configuration in the webapplication.

            Have anyone tried using JSFUnit in WAS + Seam environment ?

            Appreciate your help!

            Thanks,
            Samba

            • 3. Re: JSFUnit doesn't call my filter
              ssilvert

              A 500 error means that an HTTP request was sent. Then during the processing of that request, something on the server threw an error. Can you find that error and post it? It's probably in a log somewhere on the server.

              Stan