ParameterizationException after upgrading from 2.0.5.Final to 2.0.7.Final

Splash Forums Rewrite Users ParameterizationException after upgrading from 2.0.5.Final to 2.0.7.Final

This topic contains 9 replies, has 3 voices, and was last updated by  rbento 2 years, 10 months ago.

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

    rbento
    Participant

    Hello,

    I’ve just upgraded to 2.0.7.Final and my navigation in no longer working due to a org.ocpsoft.rewrite.exception.ParameterizationException: The value of required parameter [module] was null.

    I don’t know exactly where is it stated that the param is required, since all rules are there to be matched, or not.

    My code is pretty simple and was working fine with 2.0.5.Final, please take a look:

    @RewriteConfiguration
    public class Navigation extends HttpConfigurationProvider {
    
        @Override
        public int priority() {
    	return 10;
        }
    
        @Override
        public Configuration getConfiguration(ServletContext context) {
    
    	return ConfigurationBuilder.begin()
    
    	.addRule(Join.path("/").to("/login.xhtml").withInboundCorrection())
    
    	.addRule(Join.path("/login").to("/login.xhtml").withInboundCorrection())
    	
    	.addRule(Join.path("/error").to("/error.xhtml").withInboundCorrection())
    
    	.addRule(Join.path("/modules/dashboard")
                .to("/modules/index.xhtml").withInboundCorrection())
    	
    	.addRule(Join.path("/modules/{module}")
                .to("/modules/{module}/view.xhtml").withInboundCorrection())
    	
    	.addRule(Join.path("/modules/{module}/{submodule}")
                .to("/modules/{module}/{submodule}/view.xhtml").withInboundCorrection());	
        }
    }

    Could this be a bug?

    Thanks a lot.

    • This topic was modified 2 years, 10 months ago by  rbento.
    • This topic was modified 2 years, 10 months ago by  rbento.
    • This topic was modified 2 years, 10 months ago by  rbento.
    • This topic was modified 2 years, 10 months ago by  rbento.
    • This topic was modified 2 years, 10 months ago by  rbento.
    #24924

    Could you post the full stacktrace please?

    #24925

    rbento
    Participant

    Indeed!

    05:38:35,263 ERROR [io.undertow.request] (default task-32) Exception while generating error page /status/bug.xhtml: javax.servlet.ServletException: The value of required parameter [module] was null.
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:87) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:199) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:54) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
    	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:196) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:139) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.servlet.spec.RequestDispatcherImpl.error(RequestDispatcherImpl.java:388) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.servlet.spec.RequestDispatcherImpl.error(RequestDispatcherImpl.java:315) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:222) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:194) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:72) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:128) [undertow-servlet-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.server.HttpHandlers.executeRootHandler(HttpHandlers.java:36) [undertow-core-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:628) [undertow-core-1.0.0.Beta7.jar:1.0.0.Beta7]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_40]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_40]
    	at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
    Caused by: org.ocpsoft.rewrite.exception.ParameterizationException: The value of required parameter [module] was null.
    	at org.ocpsoft.rewrite.param.RegexParameterizedPatternBuilder.extractBoundValues(RegexParameterizedPatternBuilder.java:262) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at org.ocpsoft.rewrite.param.RegexParameterizedPatternBuilder.build(RegexParameterizedPatternBuilder.java:136) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at org.ocpsoft.rewrite.servlet.config.Substitute.performHttp(Substitute.java:98) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at org.ocpsoft.rewrite.servlet.config.HttpOperation.perform(HttpOperation.java:42) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at org.ocpsoft.rewrite.servlet.config.rule.Join.perform(Join.java:290) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at org.ocpsoft.rewrite.config.DefaultOperationBuilder$DefaultCompositeOperation.perform(DefaultOperationBuilder.java:56) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at org.ocpsoft.rewrite.config.RuleBuilder.perform(RuleBuilder.java:124) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at org.ocpsoft.rewrite.config.DefaultOperationBuilder$DefaultCompositeOperation.perform(DefaultOperationBuilder.java:56) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at org.ocpsoft.rewrite.config.RuleBuilder.perform(RuleBuilder.java:124) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at org.ocpsoft.rewrite.config.DefaultOperationBuilder$DefaultCompositeOperation.perform(DefaultOperationBuilder.java:56) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at org.ocpsoft.rewrite.config.RuleBuilder.perform(RuleBuilder.java:124) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider.rewriteHttp(DefaultHttpRewriteProvider.java:182) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at org.ocpsoft.rewrite.servlet.http.HttpRewriteProvider.rewrite(HttpRewriteProvider.java:43) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at org.ocpsoft.rewrite.servlet.impl.HttpRewriteWrappedResponse.rewrite(HttpRewriteWrappedResponse.java:432) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at org.ocpsoft.rewrite.servlet.impl.HttpRewriteWrappedResponse.encodeURL(HttpRewriteWrappedResponse.java:391) [rewrite-servlet-2.0.7.Final.jar:2.0.7.Final]
    	at com.sun.faces.context.ExternalContextImpl.encodeResourceURL(ExternalContextImpl.java:606) [jsf-impl-2.2.1-jbossorg-1.jar:]
    	at com.sun.faces.renderkit.html_basic.OutputLinkRenderer.renderAsActive(OutputLinkRenderer.java:239) [jsf-impl-2.2.1-jbossorg-1.jar:]
    	at com.sun.faces.renderkit.html_basic.OutputLinkRenderer.encodeBegin(OutputLinkRenderer.java:107) [jsf-impl-2.2.1-jbossorg-1.jar:]
    	at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:864) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1894) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) [jsf-impl-2.2.1-jbossorg-1.jar:]
    	at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:115) [jsf-impl-2.2.1-jbossorg-1.jar:]
    	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) [jsf-impl-2.2.1-jbossorg-1.jar:]
    	at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:115) [jsf-impl-2.2.1-jbossorg-1.jar:]
    	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:70) [primefaces-4.0-SNAPSHOT.jar:4.0-SNAPSHOT]
    	at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:57) [primefaces-4.0-SNAPSHOT.jar:4.0-SNAPSHOT]
    	at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:51) [primefaces-4.0-SNAPSHOT.jar:4.0-SNAPSHOT]
    	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1903) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1899) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1899) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1899) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:451) [jsf-impl-2.2.1-jbossorg-1.jar:]
    	at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) [jsf-impl-2.2.1-jbossorg-1.jar:]
    	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) [jsf-impl-2.2.1-jbossorg-1.jar:]
    	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.1-jbossorg-1.jar:]
    	at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) [jsf-impl-2.2.1-jbossorg-1.jar:]
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) [jboss-jsf-api_2.2_spec-2.2.1.jar:2.2.1]
    	... 24 more

    In this bug.xhtml there is a button like so:

    <p:button outcome="/modules/index.xhtml" value="#{labels.reload}" />

    Just, tested it again and reverting to 2.0.5.Final works fine. The button above is irrelevant.

    • This reply was modified 2 years, 10 months ago by  rbento.
    • This reply was modified 2 years, 10 months ago by  rbento.
    • This reply was modified 2 years, 10 months ago by  rbento.
    • This reply was modified 2 years, 10 months ago by  rbento.
    #24937

    Hey rbento,

    Any chance you could upload a small sample app (or your app) so that we can try running this on Wildfly ourselves? I’d really like to debug this one. Just attach it to this thread.

    Thanks!
    ~Lincoln

    #24938

    The strange part is that this does not look like a Rewrite error, but I’m guessing something changed and we are omitting or adding something that causes JSF to break, or there is some other part of the exception that is not reported in your trace.

    #24939

    Here is what I read from the stacktrace:

    • It happens while rendering /status/bug.xhtml
    • It is caused by a h:outputLink which renders a link to /modules/{module}/view.xhtml

    Could you perhaps post the relevant h:outputLink code?

    #24940

    Really weird. I checked the commits made since 2.0.5.Final. I cannot find a commit that _could_ have caused this. Weird.

    #24941

    Yeah. That’s why I want to debug. I can’t think of any reason why this would have changed.

    #25057

    I managed to reproduce this issue. I’m actually surprised that anything was working in this release because there were some really bad problems with the ConfigurationBuilder API that caused state in the ParameterStore to be lost after building on subsequent evaluations:

    I am releasing 2.0.8.Final, which contains this bugfix:

    https://github.com/ocpsoft/rewrite/issues/133

    #25076

    rbento
    Participant

    Nice work! Now it is working fine!

    Even got a nicer init message: Rewrite 2.0.8.Final initialized. 🙂

    Thanks a lot!

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

You must be logged in to reply to this topic.

Comments are closed.