Re: ViewExpiredException: No saved view state could be found for the view identifier

2015-11-20 Thread Kito Mann
It sounds like Jetty's cookie session setting isn't working correctly. Try
looking at the request and response headers to see if it's being set. If
not, you'll need to figure out why Jetty isn't setting it correctly.

On Thursday, November 19, 2015, Jojada Tirtowidjojo 
wrote:

> Hi All,
>
> I am new to JSF and Myfaces and need answers or pointers that can help me
> fix the problem I am currently having. Would you please help ?
>
> My application embeds a Jetty 9.3.6 server and uses the Apache MyFaces
> 2.2.8. It runs well with the Jetty default session tracking modes: URL and
> COOKIE but a problem arises when I change the tracking mode to 'COOKIE'
> only. As soon as I submit login details from the login page I receive the
> following exception:
>
> javax.faces.application.ViewExpiredException: /pages/login.rs - No
> saved view state could be found for the view identifier:
> /pages/login.rs
> at
> org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:183)
> at
> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:196)
> at
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:143)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
> at
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1685)
> at
> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:357)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158)
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
> at org.eclipse.jetty.server.Server.handle(Server.java:517)
> at
> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)
> at
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
> at
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
> at
> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
> at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
> at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
> at java.lang.Thread.run(Thread.java:745)
>
> Tracing the Myfaces code suggests that the previously saved
> SerializedViewCollection object in the servlet session, somehow, has gone
> missing during an attempt to restore the login view.
>
> Any comment, answer, and/or pointer is very much appreciated.
>
> Cheers,
>


-- 
___

Kito D. Mann | @kito99 | Author, JSF in Action
Web Components/Polymer, JSF/Java EE, and Liferay training and consulting
Virtua, Inc. | http://www.virtua.com |
http://www.JSFCentral.com | @jsfcentral
+1 203-998-0403

* Listen to the Enterprise Java Newscast: *http://
enterprisejavanews.com
*


Re: java.lang.IllegalStateException: Must be called before the start element is closed (attribute 'id')

2015-11-20 Thread l.pe...@senat.fr

On 19/11/2015 11:01, l.pe...@senat.fr wrote:

On 18/11/2015 17:53, l.pe...@senat.fr wrote:

On 17/11/2015 13:11, l.pe...@senat.fr wrote:

On 17/11/2015 01:21, Howard W. Smith, Jr. wrote:
On Mon, Nov 16, 2015 at 2:59 PM, l.pe...@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  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.

For the record and people who might follow this thread...
I posted a question on this topic on stackoverflow : 
http://stackoverflow.com/questions/33786117/bug-with-omnifaces-1-10-when-omnipartialviewcontextstartdocument-performs-trans
This is fixed in omnifaces 2.2-SNAPSHOT and will be available in 
omnifaces 1.12.


https://github.com/omnifaces/omnifaces/issues/183#issuecomment-158347582

Ludovic



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