Rob Decker wrote:
I never logged it as a bug in jira and I don't think Jon did either. You might want to at least log the verbatim bug in jira since your code is fairly simple example that shows it clearly.
The problem is, is that my code is not simple.
I've spent the last few hours trying to create a simple WAR to replicate the problem (for someone with far more knowledge of JSF than me to debug) but the problem occurrs so intermittently that it isn't really useful.
What I can do though is 'force' the 'duplicate ID problem'.
If I remove the offending verbatim tags from my proper application I get the following stack:
2005-05-08 17:21:32,887 ERROR [org.jboss.web.localhost.Engine] ApplicationDispatcher[/surezone] Servlet.service() for servlet jsp threw exception
javax.faces.FacesException: cannot add component with id '_id174' and path : {Component-Path : [Class: javax.faces.component.UIParameter,Id: _id174]} to its parent component. Thi
s might be a problem due to duplicate ids.
at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:438)
at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:256)
at org.apache.jsp.project.projectPage_jsp._jspx_meth_f_param_0(projectPage_jsp.java:688)
at org.apache.jsp.project.projectPage_jsp._jspx_meth_h_commandLink_0(projectPage_jsp.java:650)
at org.apache.jsp.project.projectPage_jsp._jspService(projectPage_jsp.java:159)
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:324)
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.jboss.portal.portlet.impl.PortletRequestDispatcherImpl.execute(PortletRequestDispatcherImpl.java:71)
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:324)
at org.jboss.portal.server.servlet.CommandFilter.doFilter(CommandFilter.java:54)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:510)
at org.jboss.portal.portlet.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:111)
at org.apache.myfaces.context.portlet.PortletExternalContextImpl.dispatch(PortletExternalContextImpl.java:169)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:242)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300)
at org.apache.myfaces.portlet.MyFacesGenericPortlet.facesRender(MyFacesGenericPortlet.java:390)
at org.apache.myfaces.portlet.MyFacesGenericPortlet.doView(MyFacesGenericPortlet.java:261)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:235)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:163)
[TRUNCATED]
and with a small test JSF page:
2005-05-08 16:50:46,275 ERROR [org.jboss.web.localhost.Engine] ApplicationDispatcher[/errorapp] Servlet.service() for servlet jsp threw exception
javax.faces.FacesException: cannot add component with id '_id4' and path : {Component-Path : [Class: javax.faces.component.UIParameter,Id: _id4]} to its par
ent component. This might be a problem due to duplicate ids.
at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:438)
at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:256)
at org.apache.jsp.test_jsp._jspx_meth_f_param_0(test_jsp.java:263)
at org.apache.jsp.test_jsp._jspx_meth_h_commandLink_0(test_jsp.java:226)
at org.apache.jsp.test_jsp._jspx_meth_h_panelGroup_0(test_jsp.java:184)
at org.apache.jsp.test_jsp._jspx_meth_h_panelGrid_0(test_jsp.java:149)
at org.apache.jsp.test_jsp._jspx_meth_f_view_0(test_jsp.java:113)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:78)
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:324)
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:704)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:405)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:280)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300)
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.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:112)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
[TRUNCATED]
The way to force my simple JSF page to produce the above error is:
1. deploy my test app
2. start-up the server
3. request the page
4. made an addition/change to the page
5. hot-deploy the change
6. request the page (using existing session, i.e. keep brower open and do not delete any cookies)
My original JSF is:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <html> <head> </head> <body> <f:view> <h:panelGrid> <h:panelGroup> <h:commandLink action="success"> <h:commandButton value="One"/> <f:param name="action" value="one"/> </h:commandLink> <f:verbatim> </f:verbatim> <h:commandLink action="success"> <h:commandButton value="Two"/> <f:param name="action" value="two"/> </h:commandLink> </h:panelGroup> </h:panelGrid> </f:view> </body>
and then my modified one is:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <html> <head> </head> <body> <f:view> <h:panelGrid> <h:panelGroup> <h:commandLink action="success"> <h:commandButton value="One"/> <f:param name="action" value="one"/> </h:commandLink> <f:verbatim> </f:verbatim> <h:commandLink action="success"> <h:commandButton value="Two"/> <f:param name="action" value="two"/> </h:commandLink> <f:verbatim> </f:verbatim> <h:commandLink action="success"> <h:commandButton value="Three"/> <f:param name="action" value="three"/> </h:commandLink> </h:panelGroup> </h:panelGrid> </f:view> </body>
As you can see I am just adding another verbatim and commandLink tag.
It may also be of interest that in both my real and test applications the stack trace goes through commandLink and param before blowing up.
Also in my real application the stack trace does not include an immediately preceeding 'view' item. Is that because my real application is running via portlet?
Any further ideas on how to move this forward? (not sure if raising an issue in JIRA for the hot-deploy issue is right).
Thanks and regards,
Sean
--
Dr. Sean Radford, MBBS, MSc
[EMAIL PROTECTED]
http://bladesys.demon.co.uk/

