0

Our team is upgrading my very big Webapplication from Myfaces-1.1.5 to Myfaces-2.1.9 and from Tomahawk-1.1.3 to Tomahawk-1.1.14.

Problem is my current application using ajax4jsf filter..

<context-param>
    <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
    <param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>

<filter>
    <filter-name>ajax4jsf</filter-name>
    <filter-class>org.ajax4jsf.Filter</filter-class>
</filter>

I have changed the value of context param as follows

<context-param>
    <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
    <param-value>org.apache.myfaces.view.facelets.FaceletViewHandler</param-value>      
</context-param> 

Because of this I am getting exception. I have read at multiple places that with JSF 2.1, ajax4jsf filter is not required but could you please tell what should I use and how...

Feb 26, 2015 4:45:48 PM org.apache.myfaces.view.facelets.compiler.TagLibraryConf
ig loadImplicit
SEVERE: Error Loading Library: jar:file:/C:/Projects/eMessaging/EM1.4M6-LibUpgra
de_new/web/target/emessaging-webapp-1.4M6/WEB-INF/lib/ajax4jsf-1.0.6.jar!/META-I
NF/a4j.taglib.xml
java.io.IOException: Error parsing [jar:file:/C:/Projects/eMessaging/EM1.4M6-Lib
Upgrade_new/web/target/emessaging-webapp-1.4M6/WEB-INF/lib/ajax4jsf-1.0.6.jar!/M
ETA-INF/a4j.taglib.xml]:
        at org.apache.myfaces.view.facelets.compiler.TagLibraryConfig.create(Tag
LibraryConfig.java:805)
        at org.apache.myfaces.view.facelets.compiler.TagLibraryConfig.loadImplic
it(TagLibraryConfig.java:839)
        at org.apache.myfaces.view.facelets.compiler.Compiler.initialize(Compile
r.java:101)
        at org.apache.myfaces.view.facelets.compiler.Compiler.compile(Compiler.j
ava:126)
        at org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory._createFa
celet(DefaultFaceletFactory.java:300)
        at org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.access$00
0(DefaultFaceletFactory.java:53)
        at org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory$1.newInst
ance(DefaultFaceletFactory.java:114)
        at org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory$1.newInst
ance(DefaultFaceletFactory.java:111)
        at org.apache.myfaces.view.facelets.impl.FaceletCacheImpl.getFacelet(Fac
eletCacheImpl.java:83)
        at org.apache.myfaces.view.facelets.impl.FaceletCacheImpl.getFacelet(Fac
eletCacheImpl.java:50)
        at org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.getFacele
t(DefaultFaceletFactory.java:199)
        at org.apache.myfaces.view.facelets.impl.DefaultFaceletFactory.getFacele
t(DefaultFaceletFactory.java:182)
        at com.g1.emessaging.ui.EmsgFaceletViewHandler.buildView(EmsgFaceletView
Handler.java:550)
        at com.g1.emessaging.ui.EmsgFaceletViewHandler.renderView(EmsgFaceletVie
wHandler.java:607)
        at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapp
er.java:101)
        at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandle
r.java:221)
        at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderRes
ponseExecutor.java:116)
        at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:
241)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:199)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
        at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseX
MLFilter.java:75)
        at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.
  • Can I make any changes in this taglib.xml so that above parsing error doesnot appear or i have to alltogether remove this ajax4jsf filter with jsf 2.1 – Amit Aggarwal Feb 26 '15 at 12:12
  • Ajax4JSF was removed when we upgraded to JSF 2. You can read more about it at http://raibledesigns.com/rd/entry/upgrading_to_jsf_2. I'd suggest removing it from your project as well if you don't need it. – Matt Raible Feb 26 '15 at 17:11
  • Hi Matt, I cannot remove ajax4jsf from my project. Your above link has a hyperlink reference to one issue about 'replacing Ajax4JSF with RichFaces' and link for that is broken...(http://issues.appfuse.org/browse/APF-1233). Also I noticed in comment section of your link, Attila has posted the same problem as mine. Is there any way I can replace Ajax4jsf to something in appfuse 2.2.1. – Amit Aggarwal Feb 27 '15 at 08:05
  • You don't need taglib in JSF 2 – Vasil Lukach Feb 27 '15 at 18:40
  • JSF 2 has Ajax support, so you may be able to use that. See http://stackoverflow.com/questions/3138488/how-to-use-ajax-with-jsf-2-0 for more info. Otherwise, Ajax4JSF was added to the RichFaces project, so you could use that. http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/GettingStarted.html – Matt Raible Feb 28 '15 at 16:27
  • My web.xml has one entry for filter. ajax4jsf org.ajax4jsf.Filter . I could not find this class 'org.ajax4jsf.Filter' in default myfaces jar. I included Richfaces dependency in my project. This particular class is present in richfaces-impl-jsf2-3.3.4.Final jar. I am able to remove dependency of ajax4jsf and jsf-facelets-1.1.14.jar from my project. – Amit Aggarwal Mar 16 '15 at 07:44
  • Whats is replacement of follwing if someone wants to use JSF2 default AJAX support and want to remover ajax4jsf or richfaces from the project. ajax4jsf org.ajax4jsf.Filter ------------------------------------------------------- ajax4jsf faces REQUEST FORWARD – Amit Aggarwal May 25 '15 at 08:31

0 Answers0