5 Replies Latest reply on Nov 26, 2007 10:03 AM by thesid

    JSFUnit - Running with JDK 1.4

      Greetings,

      I've already read the JIRA entry, that JDK 1.4 is not supported for JSFUnit. However there is projects like retroweaver and retrotranslation which allow features of 1.5 being used when running a java 1.4 environment. And seeing how JBOSS works with similar technologies I hoped it may work too for me ;)

      I've set up my system using tomcat, weaving the libraries that are necessary for running jsfunit (including the core snapshot). The files I downloaded today.

      There was no message about incorrect java version. However when trying to run a test, i got two different types of exceptions:

      21.11.2007 13:18:15 org.apache.catalina.core.StandardWrapperValve invoke
      SCHWERWIEGEND: Servlet.service() for servlet ServletRedirector threw exception
      java.lang.NoSuchMethodError: java.lang.ThreadLocal.remove()V
      at org.jboss.jsfunit.framework.WebConversationFactory.removeThreadLocals(WebConversationFactory.java:80)
      at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:128)
      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:534)



      21.11.2007 13:18:15 org.apache.catalina.core.StandardWrapperValve invoke
      SCHWERWIEGEND: Servlet.service() for servlet faces-servlet threw exception
      java.lang.IllegalStateException: FacesContext already released
      at org.apache.myfaces.context.servlet.ServletFacesContextImpl.getExternalContext(ServletFacesContextImpl.java:100)
      at org.jboss.jsfunit.context.JSFUnitFacesContext.release(JSFUnitFacesContext.java:170)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:161)
      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

      Anyone having clues on how to get JSFUnit to run with JDK1.4?

        • 1. Re: JSFUnit - Running with JDK 1.4
          ssilvert

          Those two stack traces are probably related.

          ThreadLocal.remove() is not supported in JDK 1.4. Perhaps retroweaver isn't working for that methond?

          Stan

          • 2. Re: JSFUnit - Running with JDK 1.4

            I almost sensed that neither retroweaver nor retrotranslator can cope with that method.

            Is there a way you could avoid this kind of method and make JSFUnit runnable with retroweaver/-translator?

            I'd like to use it for processing the interactive workflow automatically (having an input file with necessary values). Sadly the avaiable JDK on the target platform is 1.4.

            There's no other framework that could achieve this as good as JSFUnit - therefore my cry for help.

            • 3. Re: JSFUnit - Running with JDK 1.4
              ssilvert

              I'll do my best to answer your cry. Open up a jira task and I'll see what can be done. I don't know if I can get to it soon because of the upcoming beta release and Javapolis. But after that I'll be looking into our plans for Beta 2, so I'll think about removing it then.

              In the mean time, see what happens when you replace ThreadLocal.remove() with ThreadLocal.set(null). Let me know if the JSFUnit unit tests still run and it works with retroweaver or retrotranslator.

              Stan

              • 4. Re: JSFUnit - Running with JDK 1.4

                I exchanged the remove() with set(null); - this helped to avoid one of the exceptions.

                The other exception however still is being raised

                26.11.2007 14:51:05 org.apache.myfaces.lifecycle.PhaseListenerManager informPhaseListenersAfter
                SCHWERWIEGEND: Exception in PhaseListener RENDER_RESPONSE(6) afterPhase
                java.lang.IllegalStateException: FacesContext already released
                 at org.apache.myfaces.context.servlet.ServletFacesContextImpl.getExternalContext(ServletFacesContextImpl.java:103)
                 at org.jboss.jsfunit.context.JSFUnitFacesContext.getExternalContext(JSFUnitFacesContext.java:114)
                 at org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener.getJavaScriptCodeAndStoreInRequest(ExtensionsPhaseListener.java:87)
                 at org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener.afterPhase(ExtensionsPhaseListener.java:70)
                 at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:92)
                 at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:134)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
                 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 de.docware.util.j2eeimpl.filter.OmitDoubleRequestsFilter.showNewPageWithoutSession(OmitDoubleRequestsFilter.java:155)
                 at de.docware.util.j2eeimpl.filter.OmitDoubleRequestsFilter.doFilter(OmitDoubleRequestsFilter.java:99)
                 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:534)
                

                In a fresh project however the error did not get called. Removing all custom filters did not help on this matter.


                • 5. Re: JSFUnit - Running with JDK 1.4

                  26.11.2007 14:56:07 org.apache.myfaces.lifecycle.PhaseListenerManager informPhaseListenersAfter
                  SCHWERWIEGEND: Exception in PhaseListener RENDER_RESPONSE(6) afterPhase
                  java.lang.IllegalStateException: FacesContext already released
                  at org.apache.myfaces.context.servlet.ServletFacesContextImpl.getExternalContext(ServletFacesContextImpl.java:103)
                  at org.jboss.jsfunit.context.JSFUnitFacesContext.getExternalContext(JSFUnitFacesContext.java:114)
                  at org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener.getJavaScriptCodeAndStoreInRequest(ExtensionsPhaseListener.java:87)
                  at org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener.afterPhase(ExtensionsPhaseListener.java:70)
                  at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:92)
                  at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:134)
                  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                  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:534)

                  (Error stack with custom filters deactivated)