1 Reply Latest reply on Mar 29, 2011 6:40 AM by Viswanath Rajashekar

    java.lang.ClassCastException: javax.servlet.jsp.tagext.TagSupport tag incompatible with javax.faces.component.UIComponent

    Viswanath Rajashekar Newbie

      Hi All,

       

        I am using facelets in our application. While I'm trying to include the tag returned from class implementing javax.servlet.jsp.tagext.TagSupport, I'm getting java.lang.ClassCastException: class name (implementing javax.servlet.jsp.tagext.TagSupport tag) incompatible with javax.faces.component.UIComponent. The configuration being made as follows :

       

      xhtml file:

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"

      xmlns:ui="http://java.sun.com/jsf/facelets"

      xmlns:h="http://java.sun.com/jsf/html"

      xmlns:f="http://java.sun.com/jsf/core"

      xmlns:rich="http://richfaces.org/rich"

      xmlns:a4j="http://richfaces.org/a4j"

      xmlns:sf="http://www.springframework.org/tags/faces"

      xmlns:melalogin="http://sovelluksenvaihtolistatag.tag/customTags">

       

      tag used as : <melalogin:sovelluksenvaihtolistatag />

       

      taglib.xml:

      <facelet-taglib>

      <namespace>http://sovelluksenvaihtolistatag.tag/customTags</namespace>

      <tag>

      <tag-name>sovelluksenvaihtolistatag</tag-name>

      <component>

      <component-type>sovelluksenvaihtolistatag.component</component-type>

      </component>

      </tag>

      </facelet-taglib>

       

      faces-config.xml:

       

      <component>

         <component-type>sovelluksenvaihtolistatag.component</component-type>

         <component-class>com.tieto.tkp.login.SovelluksenVaihtoListaTag</component-class>

        </component>

       

      web.xml:

       

      <context-param>

        <param-name>facelets.LIBRARIES</param-name>

        <param-value>/WEB-INF/sovelluksenvaihtolistatag.taglib.xml</param-value>

      </context-param>

       

      Does the facelet support the jsp tag? Is there any additional configurations to be made?

       

      Regards

      Viswanath

        • 1. java.lang.ClassCastException: javax.servlet.jsp.tagext.TagSupport tag incompatible with javax.faces.component.UIComponent
          Viswanath Rajashekar Newbie

          Adding the error log:

           

          [3/29/11 11:25:08:734 EEST] 0000001f application   W   JSF1004: Cannot instantiate component of type sovelluksenvaihtolistatag.component

          [3/29/11 11:25:08:734 EEST] 0000001f viewhandler   E   Error Rendering View[/index.xhtml]

                                           javax.faces.FacesException: java.lang.ClassCastException: com.tieto.tkp.login.SovelluksenVaihtoListaTag incompatible with javax.faces.component.UIComponent

          at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:564)

          at com.sun.facelets.tag.jsf.ComponentHandler.createComponent(ComponentHandler.java:243)

          at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:139)

          at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)

          at com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:109)

          at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:119)

          at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)

          at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)

          at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)

          at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)

          at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)

          at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:144)

          at com.sun.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:60)

          at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:73)

          at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)

          at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:119)

          at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)

          at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)

          at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)

          at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)

          at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)

          at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:144)

          at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)

          at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)

          at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)

          at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)

          at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)

          at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)

          at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)

          at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)

          at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)

          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)

          at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)

          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)

          at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443)

          at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1384)

          at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)

          at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

          at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

          at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

          at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

          at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)

          at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)

          at fi.mela.masha.login.MelaLoginFilter.doFilter(MelaLoginFilter.java:101)

          at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)

          at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)

          at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)

          at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:852)

          at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:785)

          at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)

          at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)

          at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)

          at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:859)

          at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)

          at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)

          at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)

          at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)

          at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)

          at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)

          at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)

          at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)

          at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)

          at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)

          at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)

          at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)

          at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)

          Caused by: java.lang.ClassCastException: com.tieto.tkp.login.SovelluksenVaihtoListaTag incompatible with javax.faces.component.UIComponent

          at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:558)

          ... 65 more