Rewrite Integration Faces compatibility

Splash Forums Rewrite Users Rewrite Integration Faces compatibility

This topic contains 9 replies, has 2 voices, and was last updated by  Lincoln Baxter III 4 years, 10 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #18612

    detestable
    Participant

    Since I added rewrite-integration-faces to my project, whenever I hit a page which involves a rules that contains a PhaseBinding.to(El.property("#{segmentBean.identifier}")).after(PhaseId.RESTORE_VIEW)) I’m getting a stack trace :

    WARNING: StandardWrapperValve[default]: PWC1406: Servlet.service() for servlet default threw exception

    java.lang.IllegalStateException

    at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:506)

    at javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:164)

    at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:880)

    at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:466)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)

    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

    at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:183)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

    at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)

    at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)

    at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)

    at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)

    at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:380)

    at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)

    at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)

    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)

    at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)

    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)

    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)

    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)

    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)

    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)

    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

    at java.lang.Thread.run(Thread.java:722)

    I don’t know if it could be linked but I’m using shiro. The application server is glassfish 3.1.2.

    (The page is rendered correctly)

    #22826

    Hmmm… it looks like something is trying to send an error code after the response has already been committed to the client. Strange. JSF sometimes queues exceptions, but this seems odd. Perhaps you could try to reproduce this in a sample application or Arquillian Rewrite Test Case? Just attach it to this thread and I’ll try to take a look!

    #22827

    My recommendation otherwise would be to try stepping through all of the code on a page that is giving you the erroneous messages. Try to see what is throwing the exception or triggering the error code.

    #22828

    detestable
    Participant

    I made a sample application that is throwing the exception.

    Two pages, two urls :

    http://localhost:8080/rewrite-faces-test/

    http://localhost:8080/rewrite-faces-test/product/123

    The first one won’t send any error while the second one will.

    Sorry for being verbose,here is the stack trace from the sample project :

    WARNING: StandardWrapperValve[default]: PWC1406: Servlet.service() for servlet default threw exception

    java.lang.IllegalStateException

    at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:506)

    at javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:164)

    at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:880)

    at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:466)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)

    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

    at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:183)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)

    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)

    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)

    at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)

    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)

    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)

    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)

    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)

    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)

    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

    at java.lang.Thread.run(Thread.java:722)

    One more time I’m using glassfish 3.1.2

    I can now safely say that shiro isn’t involved in this stack trace!

    #22829

    You are indeed correct. I’ve reproduced the issue on JBoss AS7. Now debugging.

    #22830

    Ok. So I’m not really sure why you are getting illegalstateexception, except however, that it might be because you had both a Forward and a Join for some reason- I’m really not sure. I did however figure out that the reason you were doing this was probably because the bindings on Join rules were not working.

    I’ve fixed this in 1.0.6-SNAPSHOT:

    @Override
    public Configuration getConfiguration(ServletContext t)
    {
    return ConfigurationBuilder
    .begin()
    .addRule(Join.path("/product/{productId}").to("/WEB-INF/faces/product.xhtml")
    .where("productId")
    .bindsTo(PhaseBinding.to(El.property("#{productBean.productId}"))
    .after(PhaseId.RESTORE_VIEW)));
    }

    You should now be able to properly bind to Join rule parameters. You shouldn’t experience an error this way.

    I’m releasing 1.0.6.Final now. The next release will probably be 2.0 in a few weeks with many new features.

    #22831

    detestable
    Participant

    I’m trying to use your rule with 1.0.6-SNAPSHOT but the binding still doesn’t occur.

    I updated the sample application.

    Thank you for your support!

    PS : The error disappeared by the way ;-)

    #22832

    Yeah I don’t think a new SNAPSHOT has been published yet, but I am doing the release of version 1.1.0.Final now (minor backwards compatibility issue, so had to bump up the version)

    I verified it in your project and it works fine :) so hang on a few minutes and you’ll be set.

    #22833

    detestable
    Participant

    I can confirm everything is working now with 1.1.0-FINAL, well done!

    Keep up the good work!

    #22834

    Awesome! Glad it’s working for you now. This was a good bug to find! Also the 1.1.0 release makes me happy :) I feel like we’re making good progress. Thanks for your help in making it a more stable release! (The uploaded projects make it really easy. I just turn your configuration into a test-case!)

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

Comments are closed.