You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Hycel Taylor <hy...@comcast.net> on 2004/11/12 19:30:52 UTC

Strange exception using commandLink

Hello,

I've recently started using the MyFaces api.  One of the primary reasons I'm using MyFaces is for its support of Struts Tiles. I've been using the MyFaces Struts tiles feature and its working fine.  However, when ever and where ever I try to use a commandLink component, I always get an exception to the affect of the following (see attached file containing full exception):

exception
java.lang.NoSuchFieldError: bodyContent
 at com.sun.faces.taglib.html_basic.CommandLinkTag.doEndTag(CommandLinkTag.java:498)
....

If I use a commandButton component, everything works fine.  For example, when a commandButton component is being used, the follow code will work just fine: 

<h:panelGrid id="linkPanelGridLinks" columns="4" rendered="#{PersonBean.linkPanelVisible}">
    <h:commandButton id="submit" value="#{Message.person_link_addresses}" action="#{PersonBean.addressLink}"/>
    ..
</h:panelGrid>

However, the exact same code using the commandLink component will cause the exception I described above.

<h:panelGrid id="linkPanelGridLinks" columns="4" rendered="#{PersonBean.linkPanelVisible}">
    <h:commandLink id="submit" value="#{Message.person_link_addresses}" action="#{PersonBean.addressLink}"/>
    ..
</h:panelGrid>

Has any one run into this issue or know of a solution to this problem?

Thanks for any help,

Hycel

Re: Strange exception using commandLink

Posted by Manfred Geiler <ma...@apache.org>.
Hycel,
You still have the sub faces classes in your classpath:
  java.lang.NoSuchFieldError: bodyContent at
com.sun.faces.taglib.html_basic.CommandLinkTag.doEndTag(CommandLinkTag.java:498)
^^^^^^^^^^^^^^

Removing them should solve your problem.

Manfred




Hycel Taylor wrote:
> Hello,
>  
> I've recently started using the MyFaces api.  One of the primary reasons 
> I'm using MyFaces is for its support of Struts Tiles. I've been using 
> the MyFaces Struts tiles feature and its working fine.  However, when 
> ever and where ever I try to use a */commandLink/* component, I always 
> get an exception to the affect of the following (see attached file 
> containing full exception):
>  
> exception
> java.lang.NoSuchFieldError: bodyContent
>  at 
> com.sun.faces.taglib.html_basic.CommandLinkTag.doEndTag(CommandLinkTag.java:498)
> ....
>  
> If I use a */commandButton /*component, everything works fine.  For 
> example, when a */commandButton/* component is being used, the follow 
> code will work just fine:
>  
> <h:panelGrid id="linkPanelGridLinks" columns="4" 
> rendered="#{PersonBean.linkPanelVisible}">
>     <h:*commandButton* id="submit" 
> value="#{Message.person_link_addresses}" 
> action="#{PersonBean.addressLink}"/>
>     ..
> </h:panelGrid>
>  
> However, the exact same code using the */commandLink/* component will 
> cause the exception I described above.
>  
> <h:panelGrid id="linkPanelGridLinks" columns="4" 
> rendered="#{PersonBean.linkPanelVisible}">
>     <h:*commandLink* id="submit" 
> value="#{Message.person_link_addresses}" 
> action="#{PersonBean.addressLink}"/>
>     ..
> </h:panelGrid>
>  
> Has any one run into this issue or know of a solution to this problem?
>  
> Thanks for any help,
>  
> Hycel
> 
> 
> ------------------------------------------------------------------------
> 
> 2004-11-09 16:10:33 StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
> 2004-11-09 16:10:33 StandardContext[/jsp-examples]ContextListener: contextInitialized()
> 2004-11-09 16:10:33 StandardContext[/jsp-examples]SessionListener: contextInitialized()
> 2004-11-09 16:10:33 StandardContext[/servlets-examples]ContextListener: contextInitialized()
> 2004-11-09 16:10:33 StandardContext[/servlets-examples]SessionListener: contextInitialized()
> 2004-11-09 16:11:40 ApplicationDispatcher[/testadmin] Servlet.service() for servlet jsp threw exception
> java.lang.NoSuchFieldError: bodyContent
> 	at com.sun.faces.taglib.html_basic.CommandLinkTag.doEndTag(CommandLinkTag.java:498)
> 	at org.apache.jsp.person.person_jsp._jspx_meth_h_commandLink_0(person_jsp.java:364)
> 	at org.apache.jsp.person.person_jsp._jspx_meth_h_panelGrid_2(person_jsp.java:328)
> 	at org.apache.jsp.person.person_jsp._jspx_meth_h_form_0(person_jsp.java:157)
> 	at org.apache.jsp.person.person_jsp._jspService(person_jsp.java:101)
> 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
> 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
> 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
> 	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
> 	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:589)
> 	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
> 	at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
> 	at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:581)
> 	at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)
> 	at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
> 	at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)
> 	at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881)
> 	at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)
> 	at org.apache.jsp.common.adminLayout_jsp._jspx_meth_tiles_insert_2(adminLayout_jsp.java:395)
> 	at org.apache.jsp.common.adminLayout_jsp._jspx_meth_f_subview_2(adminLayout_jsp.java:373)
> 	at org.apache.jsp.common.adminLayout_jsp._jspx_meth_h_panelGrid_0(adminLayout_jsp.java:209)
> 	at org.apache.jsp.common.adminLayout_jsp._jspx_meth_f_view_0(adminLayout_jsp.java:151)
> 	at org.apache.jsp.common.adminLayout_jsp._jspService(adminLayout_jsp.java:89)
> 	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
> 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
> 	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
> 	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
> 	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
> 	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
> 	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
> 	at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
> 	at net.sourceforge.myfaces.application.jsp.JspTilesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:178)
> 	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
> 	at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
> 	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
> 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:110)
> 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> 	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> 	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
> 	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
> 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
> 	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
> 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
> 	at java.lang.Thread.run(Thread.java:534)
>