2 Replies Latest reply on Apr 1, 2011 2:06 PM by susmit_shukla

    Getting Exception while running a JSFUnit test bundled as war

    susmit_shukla

      HI,

       

      I am getting this exception when I try to run a JSFUnit test case. The test war is big in size ~27mb and finally 503 Got 503 (Service Unavailable) exception is printed out: Getting no clue as to what could be causing this

       

      Caused by: java.lang.IllegalStateException: Error launching test com.uitest.JsfTest 
      public void com.uitest.JsfTest.testInitialPageHello(org.jboss.jsfunit.jsfsession.JSFServerSession,
      org.jboss.jsfunit.jsfsession.JSFClientSession) throws java.io.IOException

          at org.jboss.arquillian.protocol.servlet_3.ServletMethodExecutor.invoke(ServletMethodExecutor.java:61)

          at org.jboss.arquillian.impl.handler.ContainerTestExecuter.callback(ContainerTestExecuter.java:50)

          at org.jboss.arquillian.impl.handler.ContainerTestExecuter.callback(ContainerTestExecuter.java:40)

          at org.jboss.arquillian.impl.event.MapEventManager.fire(MapEventManager.java:63)

       

      Caused by: java.lang.IllegalStateException: Error launching test at http://localhost:9090/test/

      ArquillianServletRunner?outputMode=serializedObject&className=com.uitest.JsfTest&methodName=test

      InitialPageHello. Got 503 (Service Unavailable)

        • 1. Getting Exception while running a JSFUnit test bundled as war
          susmit_shukla

          On more digging, found that application under test is not able to read the jar file from temp war location and this is the error:

          2011-03-31 18:45:35,220 ERROR - Failed startup of context ShrinkWrapWebAppContext@1bdbfec@1bdbfec/test,file:/C:/Documents%20and%20Settings/user/Local%20Settings/Temp/Jetty_localhost_9090_export4261762815131158333test.war__test__wkwmj1/webapp/;jar:file:/C:/Documents%20and%20Settings/user/Local%20Settings/Temp/Jetty_localhost_9090_export4261762815131158333test.war__test__wkwmj1/webapp/WEB-INF/lib/org.glassfish.com.sun.faces-2.1.1.FCS.jar!/META-INF/resources;,file:/C:/DOCUME~1/user/LOCALS~1/Temp/export4261762815131158333test.war

          com.comp.content.repository.ContentRuntimeException: Error : The file is not jar file C:\Documents%20and%20Settings\user\Local%20Settings\Temp\Jetty_localhost_9090_export4261762815131158333test.war__test__wkwmj1\webapp\WEB-INF\lib\com.comp.abc.sdk-1.0.3.jar

              at com.comp.content.repository.Base4RepositoryFactory.getFiles(BaseRepositoryFactory.java:143)

           

          Application is not able to read the jar file because spaces are encoded

           

          Can we change the temp location where war is copied/extracted while deploying to jetty through arquillian?

          • 2. Getting Exception while running a JSFUnit test bundled as war
            susmit_shukla

            Found it,

            Jetty uses java.io.tempdir system property, passed it to surefire plugin in pom and the location of temp war extraction got changed