4 Replies Latest reply on Mar 26, 2007 3:30 PM by Paulo Cordeiro

    Woodstock and Ajax4jsf

    Paulo Cordeiro Newbie

      Hello,

      I have one project with Woodstock components.
      Now i need include Ajax4jsf but not work.
      If i put Woodstock components with ajax4jsf simply not work.

       <webuijsf:textField text="#{empenhoBacking.nome}">
       <a4j:support event="onchange" reRender="repeater1, repeater2" actionListener="#{empenhoBacking.process}" />
       </webuijsf:textField>
      


      If i put original jsf components with ajax4jsf i have one NullPointerException.

       <h:inputText size="50" value="#{empenhoBacking.nome}">
       <a4j:support event="onchange" reRender="repeater1, repeater2" actionListener="#{empenhoBacking.process}" />
       </h:inputText>
      


      [#|2007-03-26T15:13:20.285+0000|WARNING|sun-appserver-pe9.0|javax.enterprise.resource.webcontainer.jsf.lifecycle|_ThreadID=14;_ThreadName=httpWorkerThread-8080-3;_RequestID=bbfd0411-43d6-450a-b2d2-d23229f81bf2;|executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@615dc4) threw exception
      javax.faces.FacesException: javax.el.ELException: java.lang.NullPointerException
      
      ...
      


      But one simple project with original jsf components and ajax4jsf work perfect.

      My configurations:


      * Glassfish glassfish (v1_ur1-b14)
      * jsf (1.2_04-b03-RC1)
      * woodstock (4.0.1-200702150027)
      * jboss-ajax4jsf (1.1.0)
      * Java (1.5.0_09)
      * OpenSuse 10.2 Linux Server


      grateful,

      Paulo Cordeiro

        • 1. Re: Woodstock and Ajax4jsf
          Sergey Smirnov Master

          How you configure Ajax4jf? What the libraries where added. What is in your web.xml ?

          • 2. Re: Woodstock and Ajax4jsf
            Paulo Cordeiro Newbie

            My web.xml is

            <?xml version="1.0" encoding="UTF-8"?>
            <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
            
             <context-param>
             <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
             <param-value>server</param-value>
             </context-param>
            
             <context-param>
             <param-name>com.sun.webui.jsf.DEFAULT_THEME</param-name>
             <param-value>suntheme</param-value>
             </context-param>
            
             <!-- Faces Servlet -->
             <servlet>
             <servlet-name>FacesServlet</servlet-name>
             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
             <load-on-startup>1</load-on-startup>
             </servlet>
            
             <!-- Faces Servlet Mapping -->
             <servlet-mapping>
             <servlet-name>FacesServlet</servlet-name>
             <url-pattern>*.jsf</url-pattern>
             </servlet-mapping>
            
             <!-- Theme Servlet -->
             <servlet>
             <servlet-name>ThemeServlet</servlet-name>
             <servlet-class>com.sun.webui.theme.ThemeServlet</servlet-class>
             <load-on-startup>2</load-on-startup>
             </servlet>
            
             <!-- Theme Servlet Mapping -->
             <servlet-mapping>
             <servlet-name>ThemeServlet</servlet-name>
             <url-pattern>/theme/*</url-pattern>
             </servlet-mapping>
            
             <session-config>
             <session-timeout>30</session-timeout>
             </session-config>
            
             <filter>
             <display-name>Ajax4jsf Filter</display-name>
             <filter-name>ajax4jsf</filter-name>
             <filter-class>org.ajax4jsf.Filter</filter-class>
             </filter>
            
             <filter-mapping>
             <filter-name>ajax4jsf</filter-name>
             <servlet-name>FacesServlet</servlet-name>
             <dispatcher>REQUEST</dispatcher>
             <dispatcher>FORWARD</dispatcher>
             <dispatcher>INCLUDE</dispatcher>
             </filter-mapping>
            
             <filter-mapping>
             <filter-name>ajax4jsf</filter-name>
             <url-pattern>/*</url-pattern>
             </filter-mapping>
            
             <!-- Welcome File List -->
             <welcome-file-list>
             <welcome-file>index.jspx</welcome-file>
             </welcome-file-list>
            </web-app>
            
            
            


            my libraries:



            in WEB-INF/lib

            ajax4jsf-1.1.0.jar
            commons-beanutils.jar
            commons-collections.jar
            commons-digester.jar
            commons-fileupload-1.0.jar
            commons-logging.jar
            dataprovider.jar
            dojo-0.4.1-ajax.jar
            dpEJB-Model.jar
            jhall.jar
            jsf-extensions-common-0.1.jar
            jsf-extensions-dynamic-faces-0.1.jar
            json.jar
            oscache-2.3.jar
            prototype-1.5.0.jar
            richfaces-3.0.0.jar
            webui-jsf.jar
            webui-jsf-suntheme.jar


            in glassfish/lib

            jsf-api.jar
            jsf-impl.jar




            the simply header page.


            
            <?xml version='1.0' encoding='UTF-8'?>
            <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
             xmlns:webuijsf="http://www.sun.com/webui/webuijsf"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:rich="http://richfaces.ajax4jsf.org/rich"
             xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">
             <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
             doctype-system="http://www.w3.org/TR/html4/loose.dtd"
             doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" />
             <jsp:directive.page contentType="text/html;charset=UTF-8" />
             <f:view>
             ...
            


            grateful


            • 3. Re: Woodstock and Ajax4jsf
              Sergey Smirnov Master

              I see only one minor problem. You have declaring the ajax4jsf filter twice.
              What is the full stack of the exception ?

              • 4. Re: Woodstock and Ajax4jsf
                Paulo Cordeiro Newbie

                I removed the duplicity in

                 <filter-mapping>
                 <filter-name>ajax4jsf</filter-name>
                 <servlet-name>FacesServlet</servlet-name>
                 <dispatcher>REQUEST</dispatcher>
                 <dispatcher>FORWARD</dispatcher>
                 <dispatcher>INCLUDE</dispatcher>
                 </filter-mapping>
                
                
                 <!--
                 <filter-mapping>
                 <filter-name>ajax4jsf</filter-name>
                 <url-pattern>/*</url-pattern>
                 </filter-mapping>
                 -->
                
                


                My stack exception is

                
                [#|2007-03-26T19:18:55.768+0000|INFO|sun-appserver-pe9.0|com.opensymphony.oscache.web.ServletCacheAdministrator|_ThreadID=13;_ThreadName=httpWorkerThread-8080-0;|Created new instance of ServletCacheAdministrator|#]
                
                [#|2007-03-26T19:18:55.769+0000|INFO|sun-appserver-pe9.0|com.opensymphony.oscache.web.ServletCacheAdministrator|_ThreadID=13;_ThreadName=httpWorkerThread-8080-0;|Created new application-scoped cache at key: __oscache_cache|#]
                
                [#|2007-03-26T19:19:15.172+0000|WARNING|sun-appserver-pe9.0|javax.enterprise.resource.webcontainer.jsf.lifecycle|_ThreadID=11;_ThreadName=httpWorkerThread-8080-1;_RequestID=cb1ef843-3ab3-4705-a4d4-92d804f93ec3;|executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@531d2a) threw exception
                javax.faces.FacesException: javax.el.ELException: java.lang.NullPointerException
                 at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:1550)
                 at com.sun.faces.renderkit.RenderKitUtils.renderPassThruAttributes(RenderKitUtils.java:440)
                 at com.sun.faces.renderkit.RenderKitUtils.renderPassThruAttributes(RenderKitUtils.java:393)
                 at com.sun.faces.renderkit.html_basic.TextRenderer.getEndTextToRender(TextRenderer.java:119)
                 at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:204)
                 at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
                 at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:279)
                 at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:242)
                 at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
                 at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
                 at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
                 at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
                 at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
                 at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:244)
                 at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:174)
                 at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                 at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:256)
                 at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
                 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                 at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                 at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
                 at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
                 at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:216)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
                 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
                 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
                 at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
                 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
                 at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
                 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
                 at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
                 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
                 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
                 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
                 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
                 at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
                 at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
                 at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
                 at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
                 at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
                 at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
                 at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
                 at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
                Caused by: javax.el.ELException: java.lang.NullPointerException
                 at javax.faces.component.ValueExpressionValueBindingAdapter.getValue(ValueExpressionValueBindingAdapter.java:76)
                 at javax.faces.component.html.HtmlInputText.getOnchange(HtmlInputText.java:337)
                 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 javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:1542)
                 ... 55 more
                Caused by: java.lang.NullPointerException
                 at org.ajax4jsf.framework.renderer.AjaxRendererUtils.buildAjaxFunction(AjaxRendererUtils.java:364)
                 at org.ajax4jsf.framework.renderer.AjaxRendererUtils.buildAjaxFunction(AjaxRendererUtils.java:343)
                 at org.ajax4jsf.framework.renderer.AjaxRendererUtils.buildOnEvent(AjaxRendererUtils.java:156)
                 at org.ajax4jsf.ajax.UIAjaxSupport.getEventString(UIAjaxSupport.java:115)
                 at org.ajax4jsf.framework.ajax.EventValueBinding.getValue(EventValueBinding.java:87)
                 at javax.faces.component.ValueExpressionValueBindingAdapter.getValue(ValueExpressionValueBindingAdapter.java:73)
                 ... 61 more
                |#]
                
                [#|2007-03-26T19:19:15.188+0000|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_ThreadID=11;_ThreadName=httpWorkerThread-8080-1;_RequestID=cb1ef843-3ab3-4705-a4d4-92d804f93ec3;|StandardWrapperValve[FacesServlet]: Servlet.service() for servlet FacesServlet threw exception
                java.lang.NullPointerException
                 at org.ajax4jsf.framework.renderer.AjaxRendererUtils.buildAjaxFunction(AjaxRendererUtils.java:364)
                 at org.ajax4jsf.framework.renderer.AjaxRendererUtils.buildAjaxFunction(AjaxRendererUtils.java:343)
                 at org.ajax4jsf.framework.renderer.AjaxRendererUtils.buildOnEvent(AjaxRendererUtils.java:156)
                 at org.ajax4jsf.ajax.UIAjaxSupport.getEventString(UIAjaxSupport.java:115)
                 at org.ajax4jsf.framework.ajax.EventValueBinding.getValue(EventValueBinding.java:87)
                 at javax.faces.component.ValueExpressionValueBindingAdapter.getValue(ValueExpressionValueBindingAdapter.java:73)
                 at javax.faces.component.html.HtmlInputText.getOnchange(HtmlInputText.java:337)
                 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 javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:1542)
                 at com.sun.faces.renderkit.RenderKitUtils.renderPassThruAttributes(RenderKitUtils.java:440)
                 at com.sun.faces.renderkit.RenderKitUtils.renderPassThruAttributes(RenderKitUtils.java:393)
                 at com.sun.faces.renderkit.html_basic.TextRenderer.getEndTextToRender(TextRenderer.java:119)
                 at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:204)
                 at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:833)
                 at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:279)
                 at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:242)
                 at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
                 at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
                 at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
                 at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
                 at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
                 at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
                 at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:244)
                 at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:174)
                 at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                 at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:256)
                 at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
                 at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                 at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                 at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
                 at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
                 at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:216)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
                 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
                 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
                 at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
                 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
                 at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
                 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
                 at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
                 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
                 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
                 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
                 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
                 at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
                 at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
                 at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
                 at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
                 at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
                 at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
                 at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
                 at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
                |#]