Path param fails with ParameterizationException

Splash Forums Rewrite Users Path param fails with ParameterizationException

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

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #25032

    sam.shm
    Participant

    Hi,

    I try to use path param with urlrewrite

    
        @Override
        public Configuration getConfiguration(final ServletContext context) {
            return ConfigurationBuilder.begin()
                    .addRule(Join.path("/store/{s}").to("/{s}/test.html"))
                    .perform(Log.message(Logger.Level.INFO, "!!!!!!!!!!!!!!!!!!"));
        }

    If i call in browser the following url:
    http://localhost:8080/mywebapp/store/public

    I get:

    Type Exception report
    
    messageInternal Server Error
    
    descriptionThe server encountered an internal error that prevented it from fulfilling this request.
    
    exception
    
    javax.servlet.ServletException: Error during Rewrite processing. Please inspect stack trace for root cause.
    root cause
    
    org.ocpsoft.rewrite.exception.ParameterizationException: The value of required parameter [s] was null.

    Any ideas appreciated, thanks

    #25035

    Which version of Rewrite do you use? Could you post the full stacktrace from the logs?

    #25036

    sam.shm
    Participant

    Hi,

    Version 2.0.7 (latest)

    WARNING:   StandardWrapperValve[default]: Servlet.service() for servlet default threw exception
    org.ocpsoft.rewrite.exception.ParameterizationException: The value of required parameter [s] was null.
    	at org.ocpsoft.rewrite.param.RegexParameterizedPatternBuilder.extractBoundValues(RegexParameterizedPatternBuilder.java:262)
    	at org.ocpsoft.rewrite.param.RegexParameterizedPatternBuilder.build(RegexParameterizedPatternBuilder.java:136)
    	at org.ocpsoft.rewrite.servlet.config.Forward.performHttp(Forward.java:85)
    	at org.ocpsoft.rewrite.servlet.config.HttpOperation.perform(HttpOperation.java:42)
    	at org.ocpsoft.rewrite.servlet.config.rule.Join.perform(Join.java:264)
    	at org.ocpsoft.rewrite.config.DefaultOperationBuilder$DefaultCompositeOperation.perform(DefaultOperationBuilder.java:56)
    	at org.ocpsoft.rewrite.config.RuleBuilder.perform(RuleBuilder.java:124)
    	at org.ocpsoft.rewrite.config.DefaultOperationBuilder$DefaultCompositeOperation.perform(DefaultOperationBuilder.java:56)
    	at org.ocpsoft.rewrite.config.RuleBuilder.perform(RuleBuilder.java:124)
    	at org.ocpsoft.rewrite.config.DefaultOperationBuilder$DefaultCompositeOperation.perform(DefaultOperationBuilder.java:56)
    	at org.ocpsoft.rewrite.config.RuleBuilder.perform(RuleBuilder.java:124)
    	at org.ocpsoft.rewrite.servlet.impl.DefaultHttpRewriteProvider.rewriteHttp(DefaultHttpRewriteProvider.java:182)
    	at org.ocpsoft.rewrite.servlet.http.HttpRewriteProvider.rewrite(HttpRewriteProvider.java:43)
    	at org.ocpsoft.rewrite.servlet.RewriteFilter.rewrite(RewriteFilter.java:241)
    	at org.ocpsoft.rewrite.servlet.RewriteFilter.doFilter(RewriteFilter.java:187)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
    	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
    	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
    	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
    	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
    	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
    	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
    	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
    	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
    	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
    	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
    	at java.lang.Thread.run(Thread.java:722)
    
    #25037

    Hmmm. Interesting. I cannot reproduce this in my test setup.

    Could you please show which Rewrite dependencies (which modules) you added to your project?

    #25038

    sam.shm
    Participant

    Hi,

    I use:
    1.Netbeans
    2. Ant Libraries
    3. External jars:
    rewrite-servlet-2.0.7.Final.jar

    #25039

    I think your need to add at least one of the following additional dependencies to get it work correctly:

    • rewrite-integration-cdi
    • rewrite-integration-faces
    • rewrite-integration-spring

    Which one to choose depends on the frameworks you are using. But in a JEE container it typically makes sense to add rewrite-integration-cdi.

    #25040

    sam.shm
    Participant

    Hi,

    Ok.

    I added:

    rewrite-integration-faces

    I get deploy error:

    deploy?DEFAULT=/home/sam/NetBeansProjects/AppTest/dist/gfdeploy/AppTest&name=AppTest&force=true failed on GlassFish Server 4.0 WEB 
     Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: 
      Source Document: jar:file:/home/sam/NetBeansProjects/AppTest/dist/gfdeploy/AppTest/lib/rewrite-integration-faces-2.0.7.Final.jar!/META-INF/faces-config.xml
      Cause: Class 'org.ocpsoft.rewrite.faces.RewritePhaseListener' is missing a runtime dependency: java.lang.NoClassDefFoundError: org/ocpsoft/rewrite/event/Flow. Please see server.log for more details.
    #25041

    Yeah, this is a really weird Glassfish issue. Have a look at this post. I think placing the JAR in the Glassfish lib folder fixes this folder or something like this:

    http://ocpsoft.org/support/topic/cannot-deploy-project-if-i-add-integration-faces-2-0-5-jar/

    #25056

    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

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

You must be logged in to reply to this topic.

Comments are closed.