myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "l.penet@senat.fr" <l.pe...@senat.fr>
Subject Re: java.lang.IllegalStateException: Must be called before the start element is closed (attribute 'id')
Date Wed, 18 Nov 2015 16:53:28 GMT
On 17/11/2015 13:11, l.penet@senat.fr wrote:
> On 17/11/2015 01:21, Howard W. Smith, Jr. wrote:
>> On Mon, Nov 16, 2015 at 2:59 PM, l.penet@senat.fr <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.

I think I found what causes the bug...

I mentioned that I use :

     PrimeFaces 5.3.1
     MyFaces 2.2.8
     OpenWebBeans 1.6.2


I forgot to mention that I also use :

     omnifaces 1.10


I also noticed that the bug happens when :
* an ajax request is triggered
* the session is expired (for some reason I have yet to found, but it is 
another problem)

The access to the ajax requested page is controlled by the container 
with a <security-constraint> declaration in the webapp web.xml file.

In that case

OmniPartialViewContext.java#startDocument performs a redirect
https://github.com/omnifaces/omnifaces/blob/master/src/main/java/org/omnifaces/context/OmniPartialViewContext.java#L275

and so, an opened document with an active element is *not* the current sate.

When returning from this function, up to
org.apache.myfaces.context.servlet.PartialViewContextImpl.processPartialRendering#471

there is just after, line 473 :

writer.writeAttribute("id", 
viewRoot.getContainerClientId(_facesContext),"id");

IMHO, MyFaces is right to expect to have an opened document at this 
point... So I will see with BalusC if we can imagine a patch to omnifaces.
The newer 1.1x version, the 1.11, is not different on this point.

Thanks,

Ludovic

|
| AVANT D'IMPRIMER, PENSEZ A L'ENVIRONNEMENT.
|


Mime
View raw message