myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Re: java.lang.IllegalStateException: Must be called before the start element is closed (attribute 'id')
Date Tue, 17 Nov 2015 12:11:18 GMT
On 17/11/2015 01:21, Howard W. Smith, Jr. wrote:
> On Mon, Nov 16, 2015 at 2:59 PM, <> wrote:
>>   java.lang.IllegalStateException: Must be called before the start element
>> is closed (attribute 'id')
>>          at
>> org.apache.myfaces.shared.renderkit.html.HtmlResponseWriterImpl.writeAttribute(
> Searched google and found the following:
> 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("<?xml version=\"1.0\" encoding=\""+
                 (currentEncoding == null ? "UTF-8" : currentEncoding) 


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 

, 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).



View raw message