3 Replies Latest reply on Apr 15, 2009 7:04 PM by Tim Evers

    JSFUnit and richfaces 3.3.1BETA3

    Tim Evers Master

      Hey,
      I just tried to update to richfaces 3.3.1BETA3 because of a particular bug I need fixed and I'm getting the following stacktrace when running my JSFUnit tests now.

      java.lang.IllegalStateException: Error when clicking side menu option with id; createCertificate: Wrapped com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function createComment in object [object HTMLDocument]. (http://localhost:8080/gekko-tje/a4j/g/3_3_1.BETA3org/richfaces/renderkit/html/scripts/jquery/jquery.js#218) (script in http://localhost:8080/gekko-tje/certificates/assignedCertificates.jsf?conversationId=7 from (71, 54) to (71, 492)#71)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at gekko.util.ReflectionUtils.instantiateFromConstructor(ReflectionUtils.java:308)
       at gekko.util.ExceptionUtils.createException(ExceptionUtils.java:144)
       at gekko.util.ExceptionUtils.createLogged(ExceptionUtils.java:97)
       at gekko.web.jsfunit.pages.AbstractGekkoPageDriver.clickSideMenuOption(AbstractGekkoPageDriver.java:77)
       at gekko.web.jsfunit.pages.layouts.SideMenuPageDriver.clickCreateCertificate(SideMenuPageDriver.java:28)
       at gekko.web.jsfunit.pages.certificates.CertificateJSFUtil.createAndActivateCertificate(CertificateJSFUtil.java:56)
       at gekko.web.jsfunit.pages.certificates.CertificateMaintenanceTest.testSearchCertificate(CertificateMaintenanceTest.java:31)
       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:597)
       at junit.framework.TestCase.runTest(TestCase.java:168)
       at junit.framework.TestCase.runBare(TestCase.java:134)
       at org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:153)
       at org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:119)
       at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:93)
       at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:224)
       at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java)
       at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:101)
       at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:217)
       at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java)
       at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doPost(JSFUnitServletRedirector.java:45)
       at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:72)
       at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:217)
       at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java)
       at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doGet(JSFUnitServletRedirector.java:51)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:124)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
       at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:506)
       at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:51)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:364)
       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:491)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function createComment in object [object HTMLDocument]. (http://localhost:8080/gekko-tje/a4j/g/3_3_1.BETA3org/richfaces/renderkit/html/scripts/jquery/jquery.js#218) (script in http://localhost:8080/gekko-tje/certificates/assignedCertificates.jsf?conversationId=7 from (71, 54) to (71, 492)#71)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:511)
       at org.mozilla.javascript.Context.call(Context.java:502)
       at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:444)
       at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:899)
       at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventHandler(EventListenersContainer.java:152)
       at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:165)
       at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:558)
       at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:947)
       at org.mozilla.javascript.Context.call(Context.java:502)
       at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
       at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:952)
       at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:136)
       at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:107)
       at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:76)
       at gekko.web.jsfunit.util.JsfUnitTestUtils.clickSideMenuOption(JsfUnitTestUtils.java:190)
       at gekko.web.jsfunit.pages.AbstractGekkoPageDriver.clickSideMenuOption(AbstractGekkoPageDriver.java:74)
       ... 66 more
      Caused by: org.mozilla.javascript.WrappedException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function createComment in object [object HTMLDocument]. (http://localhost:8080/gekko-tje/a4j/g/3_3_1.BETA3org/richfaces/renderkit/html/scripts/jquery/jquery.js#218) (script in http://localhost:8080/gekko-tje/certificates/assignedCertificates.jsf?conversationId=7 from (71, 54) to (71, 492)#71)
       at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1657)
       at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:176)
       at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:478)
       at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3335)
       at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
       at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
       at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:401)
       at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:178)
       at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3004)
       at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
       at com.gargoylesoftware.htmlunit.javascript.host.EventHandler.call(EventHandler.java:78)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:472)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:437)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:505)
       ... 82 more
      Caused by: com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find function createComment in object [object HTMLDocument]. (http://localhost:8080/gekko-tje/a4j/g/3_3_1.BETA3org/richfaces/renderkit/html/scripts/jquery/jquery.js#218)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:511)
       at org.mozilla.javascript.Context.call(Context.java:502)
       at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:511)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:412)
       at com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:942)
       at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:358)
       at com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:222)
       at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:238)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:542)
       at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:496)
       at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:210)
       at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:329)
       at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:993)
       at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:896)
       at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:2893)
       at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1954)
       at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:893)
       at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:495)
       at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:448)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:693)
       at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:243)
       at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:127)
       at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:101)
       at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:438)
       at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:326)
       at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:351)
       at com.gargoylesoftware.htmlunit.html.HtmlForm.submit(HtmlForm.java:167)
       at com.gargoylesoftware.htmlunit.javascript.host.HTMLFormElement.jsxFunction_submit(HTMLFormElement.java:224)
       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:597)
       at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
       ... 94 more
      Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot find function createComment in object [object HTMLDocument]. (http://localhost:8080/gekko-tje/a4j/g/3_3_1.BETA3org/richfaces/renderkit/html/scripts/jquery/jquery.js#218)
       at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3558)
       at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3536)
       at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3564)
       at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3583)
       at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3647)
       at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2187)
       at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3170)
       at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2484)
       at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:178)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:403)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:505)
       ... 128 more
      


      Any ideas?

      I'm gona go try the latest versions of JSFUnit and HtmlUnit now (although I am running fairly recent versions).

      Just wondering if anyone has seen anything like this?

      By the way. This is happening when I call click on a h:commandLink.

      I tried both IE and FireFox mode.