Wayne,

I tried to deploy my app in Tomcat to test your theory about JBoss, and it worked. Tomcat's console window does not give any error messages any more, whereas JBoss does. I have tried to find the "bad" jars in JBoss shered lib, but I can't find any JSF-jars there.

One big problem still remains. In both Jboss and Tomcat, the only way to make it work without a thrown exception is to remove ALL subview tags, which contradictory to everything I have read about JSF. This is how the good code looks:

--------------
Main page:

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<html>
<head>
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8" />
  <title>MyFaces - the free JSF Implementation</title>
  <link rel="stylesheet" type="text/css" href="" />
</head>
<body>
<f:view>
 <f:loadBundle basename="org.apache.myfaces.examples.resource.example_messages"  var="example_messages" />

 <jsp:include page="res2.jsp"/>

</f:view>
</body>

</html>

----------------
Page being included (res2.jsp):

<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>

<t:div id="subnavigation">
 <t:panelNavigation2 id="nav1" layout="list" itemClass="mypage"
 activeItemClass="selected" openItemClass="open" >
 <t:navigationMenuItems value="#{navigationMenu.panelNavigationItems}" />
       </t:panelNavigation2>
</t:div>
----------------

The code above works (with  the exception of the warnings about the id:s in JBoss), but when I add the subview tag in either file, I get

javax.servlet.ServletException: Client-id : _id1 is duplicated in the faces tree.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)

java.lang.IllegalStateException: Client-id : _id1 is duplicated in the faces tree. org.apache.myfaces.application.jsp.JspStateManagerImpl.checkForDuplicateIds(JspStateManagerImpl.java:241) org.apache.myfaces.application.jsp.JspStateManagerImpl.checkForDuplicateIds(JspStateManagerImpl.java:255)
org.apache.myfaces.application.jsp.JspStateManagerImpl.checkForDuplicateIds(JspStateManagerImpl.java:255)


Could this be the same problem with the overapping JSF-jars in both Tomcat and JBoss, and in that case, which should I remove?

Thank you very much for your help,

Gabor


From:  Wayne Fay <[EMAIL PROTECTED]>
Reply-To:  "MyFaces Discussion" <[email protected]>
To:  MyFaces Discussion <[email protected]>
Subject:  Re: <jsp:include> messes up my JSF
Date:  Thu, 17 Nov 2005 09:15:18 -0600
>Many times, I've seen duplicate ids (and lots of other problems)
>caused by having multiple copies of the JSF jars loaded in your server
>at one time ie both the MyFaces and Sun JSF RI, or Myfaces-all.jar
>along with the others, etc.
>
>You mention JBoss, which comes with a MyFaces implementation in its
>shared libs directory. Before you proceed with any other attempts to
>repair etc, I would ensure that you have ONLY one copy of JSF jars
>available to your webapp.
>
>Personally, I think the best approach is to remove the JSF jars from
>the Jboss shared lib and just keep your own copy in your webapp's
>WEB-INF/lib directory. But you are welcome to do the opposite if you
>prefer.
>
>Wayne
>
>
>On 11/17/05, Gabor Kisch <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > Francesco,
> >
> > I changed the code and removed a few <f:subviews>, but I still get the same
> > exception thrown with PanelNavigation_2:
> >
> > javax.servlet.ServletException: Client-id : _id1 is duplicated in the faces
> > tree.
> > javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
> > org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
> >
> > Interestingly, when the page is first loaded, the JBoss concole window shows
> > a warning for every component on the page:
> >
> > 12:30:37,482 INFO  [[/app]] WARNING: Component _id1 just got an automatic
> > id, be cause there was no id assigned yet. If this component was created
> > dynamically (i.e. not by a JSP tag) you should assign it an explicit static
> > id or assign it the id you get from the createUniqueId from the current
> > UIViewRoot component right after creation!
> >
> > The thrown exception comes when I click one of the links...
> >
> >
> >
> > Anyone have an idea of what this might be?
> >
> > Regards,
> >
> > Gabor
> >
> >
> > ________________________________
> >
> > From:  Francesco Consumi <[EMAIL PROTECTED]>
> > Reply-To:  "MyFaces Discussion" <[email protected]>
> > To:  [email protected]
> > Subject:  RE: <jsp:include> messes up my JSF
> > Date:  Thu, 17 Nov 2005 10:57:05 +0100
> >
> > >
> > >>   As far as I can see, I am doing everything according to the
> > >>book, but it still doesn't work. For PanelNavigation_1, the CSS
> > >>styles are gone, and for PanelNavigation_2, I get a thrown
> > >>exception: "javax.servlet.ServletException: Client-id : _id1 is
> > >>duplicated in the faces tree". I have tried (re)moving <f:subviews>
> > >>back and forth and changing to <%@ include file%>, but that didn't
> > >>work either...
> > >>
> > >maybe there are too much subviews....
> > >
> > >in this form, for me, works:
> > >
> > >           <f:subview id="header">
> > >             <jsp:include page="/inc/page_header.jsp" />
> > >           </f:subview>
> > >
> > >and in page_header.jsp:
> > >
> > ><%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> > ><%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
> > ><%@ taglib uri="http://myfaces.apache.org/tomahawk"
> > prefix="t"%>
> > >
> > ><h:panelGrid id="header_group1" columns="2"
> > >styleClass="pageHeader1">
> > >   <h:outputText value="#{initParam.titProg}"/>
> > ></h:panelGrid>
> > ><h:panelGrid id="header_group2" columns="1" styleClass="pageHeader2"
> > >columnClasses="pageHeader2col1"  >
> > >   <t:jscookMenu layout="hbr" theme="ThemeOffice" >
> > >......
> > >   </t:jscookMenu>
> > ></h:panelGrid>
> > >
> > >
> > >
> > >
> > >
> > >
> > >--
> > >Francesco Consumi
> > >Ufficio Sistemi informativi
> > >Istituto degli Innocenti
> > >Piazza SS.Annunziata, 12
> > >50122 Firenze
> > >consumi at istitutodeglinnocenti.it
> > >Tel. +39 055 2037320
> > >ICQ# 12516133
> > >
> > >
> >

Reply via email to