0 Replies Latest reply on Dec 4, 2012 1:04 AM by pravinarr

    Cannot access the managed bean in jsfunit 1.3

    pravinarr

      I have created a sampe jsf app with the jars given in the getting started page.

      But when I tried to get the managed bean value it is giving me  null pointer exception.

       

      I have kept that bean in session scope even thought it is not retrieving anything

      could any one help me with this issue please

       

      this is my stacktrace

      cmaError: lineNumber=[2800] column=[0] lineSource=[null] name=[TypeError] sourceName=[http://localhost:8080/SampleJsfUnit/a4j/g/3_3_3.Final/org/richfaces/ui.pack.js.jsf] message=[TypeError: Cannot read property "_listeners" from undefined (http://localhost:8080/SampleJsfUnit/a4j/g/3_3_3.Final/org/richfaces/ui.pack.js.jsf#2800)]

      com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot read property "_listeners" from undefined (http://localhost:8080/SampleJsfUnit/a4j/g/3_3_3.Final/org/richfaces/ui.pack.js.jsf#2800)

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

          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.callFunction(JavaScriptEngine.java:531)

          at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:906)

          at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:164)

          at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:223)

          at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:696)

          at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:885)

          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.html.HtmlElement.fireEvent(HtmlElement.java:890)

          at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1156)

          at com.gargoylesoftware.htmlunit.html.HtmlPage.cleanUp(HtmlPage.java:247)

          at com.gargoylesoftware.htmlunit.TopLevelWindow.close(TopLevelWindow.java:119)

          at org.jboss.jsfunit.framework.WebClientSpec.valueUnbound(WebClientSpec.java:308)

          at org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1649)

          at org.apache.catalina.session.StandardSession.expire(StandardSession.java:756)

          at org.apache.catalina.session.StandardSession.expire(StandardSession.java:660)

          at org.apache.catalina.session.StandardSession.invalidate(StandardSession.java:1115)

          at org.apache.catalina.session.StandardSessionFacade.invalidate(StandardSessionFacade.java:150)

          at org.jboss.jsfunit.framework.JSFUnitServletRedirector.cleanUp(JSFUnitServletRedirector.java:68)

          at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doPost(JSFUnitServletRedirector.java:47)

          at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:72)

          at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:224)

          at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java)

          at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doGet(JSFUnitServletRedirector.java:52)

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

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

          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:119)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

          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:235)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)

          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)

          at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:599)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)

          at java.lang.Thread.run(Unknown Source)

      Caused by: net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot read property "_listeners" from undefined (http://localhost:8080/SampleJsfUnit/a4j/g/3_3_3.Final/org/richfaces/ui.pack.js.jsf#2800)

          at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3772)

          at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3750)

          at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3778)

          at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3797)

          at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3810)

          at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectPropNoWarn(ScriptRuntime.java:1523)

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

          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:269)

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

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

          at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:559)

          at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:524)

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

          ... 53 more

      Enclosed exception:

      net.sourceforge.htmlunit.corejs.javascript.EcmaError: TypeError: Cannot read property "_listeners" from undefined (http://localhost:8080/SampleJsfUnit/a4j/g/3_3_3.Final/org/richfaces/ui.pack.js.jsf#2800)

          at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3772)

          at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3750)

          at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3778)

          at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3797)

          at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3810)

          at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getObjectPropNoWarn(ScriptRuntime.java:1523)

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

          at script(http://localhost:8080/SampleJsfUnit/a4j/g/3_3_3.Final/org/richfaces/ui.pack.js.jsf:2800)

          at script(http://localhost:8080/SampleJsfUnit/a4j/g/3_3_3.Final/org/richfaces/ui.pack.js.jsf:10016)

          at script(http://localhost:8080/SampleJsfUnit/a4j/g/3_3_3.Final/org/richfaces/ui.pack.js.jsf:9725)

          at script(http://localhost:8080/SampleJsfUnit/a4j/g/3_3_3.Final/org/ajax4jsf/framework.pack.js.jsf:1867)

          at script(http://localhost:8080/SampleJsfUnit/a4j/g/3_3_3.Final/org/ajax4jsf/framework.pack.js.jsf:1858)

          at script(http://localhost:8080/SampleJsfUnit/a4j/g/3_3_3.Final/org/ajax4jsf/framework.pack.js.jsf:1861)

          at script(http://localhost:8080/SampleJsfUnit/a4j/g/3_3_3.Final/org/ajax4jsf/framework.pack.js.jsf:1871)

          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:269)

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

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

          at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:559)

          at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$4.doRun(JavaScriptEngine.java:524)

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

          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.callFunction(JavaScriptEngine.java:531)

          at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:906)

          at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:164)

          at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:223)

          at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:696)

          at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:885)

          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.html.HtmlElement.fireEvent(HtmlElement.java:890)

          at com.gargoylesoftware.htmlunit.html.HtmlPage.executeEventHandlersIfNeeded(HtmlPage.java:1156)

          at com.gargoylesoftware.htmlunit.html.HtmlPage.cleanUp(HtmlPage.java:247)

          at com.gargoylesoftware.htmlunit.TopLevelWindow.close(TopLevelWindow.java:119)

          at org.jboss.jsfunit.framework.WebClientSpec.valueUnbound(WebClientSpec.java:308)

          at org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1649)

          at org.apache.catalina.session.StandardSession.expire(StandardSession.java:756)

          at org.apache.catalina.session.StandardSession.expire(StandardSession.java:660)

          at org.apache.catalina.session.StandardSession.invalidate(StandardSession.java:1115)

          at org.apache.catalina.session.StandardSessionFacade.invalidate(StandardSessionFacade.java:150)

          at org.jboss.jsfunit.framework.JSFUnitServletRedirector.cleanUp(JSFUnitServletRedirector.java:68)

          at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doPost(JSFUnitServletRedirector.java:47)

          at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:72)

          at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:224)

          at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java)

          at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doGet(JSFUnitServletRedirector.java:52)

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

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

          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:119)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

          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:235)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)

          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.internalProcess(ActiveRequestResponseCacheValve.java:74)

          at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:47)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:599)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)

          at java.lang.Thread.run(Unknown Source)

      == CALLING JAVASCRIPT ==

       

        function () {

            var A = window.RichFaces.Memory;

            A.clean(document);

            A.clean(window);

        }

       

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

       

       

      thanks in advance

      praveen