5 Replies Latest reply on Jul 15, 2010 3:21 AM by Shaimaa Ward

    exception while running JSFUnit Test

    Shaimaa Ward Novice

      Dear

      i have the following exception

       

      com.gargoylesoftware.htmlunit.ScriptException: Exception invoking jsxFunction_setTimeout

      at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:527)

      at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)

      at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)

      at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:425)

      at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:400)

      at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:884)

      at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:302)

      at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:369)

      at com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:215)

      at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:235)

      at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:718)

      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)

      at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:676)

      at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1136)

        • 1. Re: exception while running JSFUnit Test
          Stan Silvert Master

          Hi Shaimaa,

           

          Can you tell us a little more about what is happening when you get this exception?  It looks like you haven't posted the full stack trace, so please post that.  Also, please post your JSFUnit source code and let us know about your JSFUnit/HtmlUnit versions and any component libraries you are using (RichFaces, etc.).

           

          Regards,

           

          Stan

          • 2. Re: exception while running JSFUnit Test
            Shaimaa Ward Novice

            ======= EXCEPTION START ========

            Exception class=[java.lang.RuntimeException]

            com.gargoylesoftware.htmlunit.ScriptException: Exception invoking jsxFunction_setTimeout

            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:527)

            at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)

            at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)

            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:425)

            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:400)

            at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:884)

            at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:302)

            at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:369)

            at com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:215)

            at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:235)

            at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:718)

            at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)

            at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:676)

            at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1136)

            at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1038)

            at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206)

            at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:329)

            at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:2999)

            at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1991)

            at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:895)

            at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499)

            at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452)

            at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

            at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:896)

            at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:350)

            at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:304)

            at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:134)

            at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:101)

            at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:420)

            at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:303)

            at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:360)

            at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:345)

            at org.jboss.jsfunit.framework.SimpleInitialRequestStrategy.doInitialRequest(SimpleInitialRequestStrategy.java:48)

            at org.jboss.jsfunit.framework.WebClientSpec.doInitialRequest(WebClientSpec.java:259)

            at org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:81)

            at test.junit.com.itsoft.ubs.sa.view.common.TestLeftControllerPage.initTestLeftControllerPage(TestLeftControllerPage.java:48)

            at test.junit.com.itsoft.ubs.sa.view.common.TestLeftControllerPage.suite(TestLeftControllerPage.java:29)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:585)

            at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:111)

            at org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java:298)

            at org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody0(ServletTestRunner.java:186)

            at org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody1$advice(ServletTestRunner.java:217)

            at org.apache.cactus.server.runner.ServletTestRunner.doGet(ServletTestRunner.java)

            at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

            at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

            at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)

            at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)

            at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)

            at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)

            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

            at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:119)

            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3368)

            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

            at weblogic.security.service.SecurityManager.runAs(Unknown Source)

            at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2117)

            at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2023)

            at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)

            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)

            at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)

            Caused by: java.lang.RuntimeException: Exception invoking jsxFunction_setTimeout

            at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:190)

            at net.sourceforge.htmlunit.corejs.javascript.FunctionObject.call(FunctionObject.java:479)

            at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1702)

            at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845)

            at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)

            at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:429)

            at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:264)

            at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3157)

            at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)

            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:416)

            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:521)

            ... 62 more

            Caused by: java.util.concurrent.RejectedExecutionException

            at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1477)

            at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:384)

            at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:177)

            at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:292)

            at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl.addJob(JavaScriptJobManagerImpl.java:201)

            at com.gargoylesoftware.htmlunit.javascript.host.Window.jsxFunction_setTimeout(Window.java:403)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:585)

            at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:164)

            ... 72 more

            Enclosed exception:

            java.lang.RuntimeException: Exception invoking jsxFunction_setTimeout

            at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:190)

            at net.sourceforge.htmlunit.corejs.javascript.FunctionObject.call(FunctionObject.java:479)

            at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1702)

            at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845)

            at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)

            at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:429)

            at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:264)

            at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3157)

            at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)

            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$3.doRun(JavaScriptEngine.java:416)

            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:521)

            at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:537)

            at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:538)

            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:425)

            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:400)

            at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:884)

            at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:302)

            at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:369)

            at com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:215)

            at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:235)

            at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:718)

            at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)

            at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:676)

            at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1136)

            at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1038)

            at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206)

            at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:329)

            at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:2999)

            at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1991)

            at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:895)

            at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499)

            at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452)

            at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

            at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:896)

            at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:350)

            at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:304)

            at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:134)

            at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:101)

            at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:420)

            at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:303)

            at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:360)

            at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:345)

            at org.jboss.jsfunit.framework.SimpleInitialRequestStrategy.doInitialRequest(SimpleInitialRequestStrategy.java:48)

            at org.jboss.jsfunit.framework.WebClientSpec.doInitialRequest(WebClientSpec.java:259)

            at org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:81)

            at test.junit.com.itsoft.ubs.sa.view.common.TestLeftControllerPage.initTestLeftControllerPage(TestLeftControllerPage.java:48)

            at test.junit.com.itsoft.ubs.sa.view.common.TestLeftControllerPage.suite(TestLeftControllerPage.java:29)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:585)

            at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:111)

            at org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java:298)

            at org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody0(ServletTestRunner.java:186)

            at org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody1$advice(ServletTestRunner.java:217)

            at org.apache.cactus.server.runner.ServletTestRunner.doGet(ServletTestRunner.java)

            at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

            at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

            at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)

            at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)

            at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)

            at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)

            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

            at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:119)

            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3368)

            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

            at weblogic.security.service.SecurityManager.runAs(Unknown Source)

            at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2117)

            at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2023)

            at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)

            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)

            at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)

            Caused by: java.util.concurrent.RejectedExecutionException

            at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1477)

            at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:384)

            at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:177)

            at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:292)

            at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl.addJob(JavaScriptJobManagerImpl.java:201)

            at com.gargoylesoftware.htmlunit.javascript.host.Window.jsxFunction_setTimeout(Window.java:403)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:585)

            at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:164)

            ... 72 more

            ======= EXCEPTION END ========

            • 3. Re: exception while running JSFUnit Test
              Stan Silvert Master

              The RejectedExecutionException shown in your latest post tells me that you are seeing this HtmlUnit bug:

              http://sourceforge.net/tracker/index.php?func=detail&aid=2956550&group_id=47038&atid=448266

               

              It looks like the fix for this didn't make it into HtmlUnit 2.7, so you'll need to find a 2.8 snapshot or wait until 2.8 GA.  I don't know if JSFUnit will work properly with 2.8 or not though.  Let me know if you have problems.

               

              Stan

              • 4. Re: exception while running JSFUnit Test
                Stan Silvert Master

                I've got some good news for you.  It looks like HtmlUnit 2.8 is expected to release early next week.  I've updated JSFUnit to use that version and I'll try to get a new JSFUnit version out as soon as I can after the HtmlUnit release.

                 

                Stan

                • 5. Re: exception while running JSFUnit Test
                  Shaimaa Ward Novice

                  Thank you Stan for your fast response i'm waiting for the new release of JSFUnit