Return-Path: X-Original-To: apmail-myfaces-users-archive@www.apache.org Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7D83F17B6A for ; Tue, 17 Nov 2015 12:11:42 +0000 (UTC) Received: (qmail 20934 invoked by uid 500); 17 Nov 2015 12:11:42 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 20883 invoked by uid 500); 17 Nov 2015 12:11:41 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 20831 invoked by uid 99); 17 Nov 2015 12:11:41 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Nov 2015 12:11:41 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id E0B76C6E5F for ; Tue, 17 Nov 2015 12:11:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.682 X-Spam-Level: X-Spam-Status: No, score=-0.682 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RP_MATCHES_RCVD=-0.582, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=senat.fr Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 6Wz1aKTKButu for ; Tue, 17 Nov 2015 12:11:31 +0000 (UTC) Received: from truman.senat.fr (truman.senat.fr [95.143.74.25]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 27058232B4 for ; Tue, 17 Nov 2015 12:11:26 +0000 (UTC) Received: by truman.senat.fr (8.14.5/8.14.5) with ESMTP id tAHCBIv3050327 for ; Tue, 17 Nov 2015 13:11:18 +0100 Received: from klebs.senat.fr (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D120E1BACCF for ; Tue, 17 Nov 2015 13:11:18 +0100 (CET) Received: from buster.senat.fr (unknown [192.168.51.10]) by klebs.senat.fr (Postfix) with ESMTP id BC8671BACCE for ; Tue, 17 Nov 2015 13:11:18 +0100 (CET) Received: from [172.17.17.146] (dsi-penet.senat.fr [172.17.17.146]) (authenticated bits=0) by buster.senat.fr (8.14.5/8.14.5) with ESMTP id tAHCBIIQ063570 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Tue, 17 Nov 2015 13:11:18 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=senat.fr; s=test; t=1447762278; bh=nU0dsjwG/DG+UMAw2inl+hoFrQiyEeLHIx0d532NoXg=; h=Subject:To:References:From:Date:In-Reply-To:From; b=SURI7SmdT7hHEWCMmiBcSR+oF038JlFGivKNBL8W1E+9UmwjDQxjzA2bp26hisBw5 2zgGn8Eljx+BfqFNUACZOtm4xbXivMfaCg8h7JIiwJFhFmEWInIhgLqHbr1trFBJ6W FFjdsAJuiPozMFGJrEvx0OpU2vjV77fPscIrygCc= Subject: Re: java.lang.IllegalStateException: Must be called before the start element is closed (attribute 'id') To: users@myfaces.apache.org References: <564A35AC.3090806@senat.fr> From: "l.penet@senat.fr" Message-ID: <564B1966.2010809@senat.fr> Date: Tue, 17 Nov 2015 13:11:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 192.168.51.10 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSVA-9.0.0.1503-8.0.0.1202-21946.007 X-TMASE-Version: IMSVA-9.0.0.1503-8.0.1202-21946.007 X-TMASE-Result: 10--16.999000-5.000000 X-TMASE-MatchedRID: QW5G6BKkLToOwH4pD14DsPHkpkyUphL9H2xvudIawkNRRyVoSU1C4LSe P3F8zgSUuaTr9bQ7JKgmtlFoVaDD+nXHdWrIeHKUA9lly13c/gHWSrKtwxqWpRPuWwH3mlrqtwq v2ehm5kluYhjC0X0iJ6ObAExGVfi7f3KdOoA7IIhjBolet/YhdOWNJG9IamrcAkmawJ00tAZqoB 46H80riZvA8LWd/TwlLb6XLHjqIvSMB90Id1YkFgRH1Nr7oERda7GKgkgPr1H2JJwxx7I3u0sIx i34LbJSZe+pKSapsq6Rk6XtYogiau9c69BWUTGwC24oEZ6SpSk+Mqg+CyrtwA== X-TMASE-SNAP-Result: 1.801202.0001-0-1-22:0,12:0 On 17/11/2015 01:21, Howard W. Smith, Jr. wrote: > On Mon, Nov 16, 2015 at 2:59 PM, l.penet@senat.fr wrote: > >> java.lang.IllegalStateException: Must be called before the start element >> is closed (attribute 'id') >> at >> org.apache.myfaces.shared.renderkit.html.HtmlResponseWriterImpl.writeAttribute(HtmlResponseWriterImpl.java:816) >> > Searched google and found the following: > > http://myfaces.apache.org/shared11/myfaces-shared-core/xref/org/apache/myfaces/shared/renderkit/html/HtmlResponseWriterImpl.html#318 > > Maybe, you can start there. Seems as though you id="..." on one of your > components may need to be fixed. Thanks for the suggestion, but it is alas not that simple. As far as I understand... In response to an AJAX request, PartialViewContextImpl#processPartialRendering is called. Lines 468 and following is : String currentEncoding = writer.getCharacterEncoding(); writer.writePreamble(""); writer.startDocument(); writer.writeAttribute("id", viewRoot.getContainerClientId(_facesContext),"id"); The exception is triggered when the attribute is set. An element is opened (and, as far as I understand, not closed) by writer.startDocument(); If ones goes up in the stack, and take a look at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1891) https://myfaces.apache.org/core22/myfaces-impl/xref/org/apache/myfaces/view/facelets/FaceletViewDeclarationLanguage.html#1891 , one can read lots of comments which makes me think that things are not simple and that there might be side effects in some complex cases. I see that I forgot to indicate the versions I am using... PrimeFaces 5.3.1 MyFaces 2.2.8 OpenWebBeans 1.6.2 All this running on Tomcat 8.0.22 (in dev) or 8.0.28 (in prod). Ludovic | | AVANT D'IMPRIMER, PENSEZ A L'ENVIRONNEMENT. |