OCPsoft Rewrite Rule no longer works after Update from 1.0.5 to 1.1.0

Splash Forums Rewrite Users OCPsoft Rewrite Rule no longer works after Update from 1.0.5 to 1.1.0

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

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
  • #19265


    See my question on stackoverflow please: http://stackoverflow.com/questions/14032854/ocpsoft-rewrite-rule-no-longer-works-after-update-from-1-0-5-to-1-1-0

    I would be happy if someone could help me :)


    As answered on StackOverflow:

    Hmm.. that does look like a bug, I’ll try to reproduce this, but you shouldn’t need to re-define {i} and {d} in the target URL. Join will handle that for you automatically if you use request binding, like so:


    I’m guessing if you do that, your problem will go away. You can also use .withInboundCorrection() if you’d like to redirect requests for the old .html URL to the new URL.

    If you still have a problem with this, please post on the support forums and we’ll get it figured out :)

    Sorry you had trouble, hopefully it won’t be trouble any more :)



    Thanks for your fast reply (:

    I changed the rule according to your post and it keeps working in 1.0.5 but fails again in 1.1.0 with the same exception as it did before.

    Edit: Just in case it’s important: The exception is already thrown at server startup, before actually requesting the rewritten URL.


    Hmmm okay. Could you perhaps upload an example app that reproduces this so that I can debug? Thanks! We’ll get it figured out, and we have a new release coming soon (2.0.0) so it will be fixed in no time.


    Ok, I figured it out. This makes sense but needs to be fixed. You can work around the issue by doing this instead. The NPE comes because the target resource location is not defined yet.




    Hi again. I finally found the time to build a small example project. The pom.xml only consists of MyFaces, the Tomcat servlet API and Rewrite. Two html files, 1 controller and the config provider. I don’t know why but i get a different exception when using 1.1.0 now:

    Exception starting filter OCPsoft Rewrite Filter
    java.lang.NoSuchMethodError: org.ocpsoft.rewrite.config.ConfigurationBuilder.addRule(Lorg/ocpsoft/rewrite/config/Rule;)Lorg/ocpsoft/rewrite/config/ConfigurationBuilder;

    I then changed the syntax according to your last post, which works for 1.0.5, but fails again in 1.1.0 with the said exception. I attached the .war and the exported eclipse project with the source files:



    Sorry, i can’t upload the 4MB .war for whatever reason… then just the project:

    You can test the application here:http://nachtmenschen.net:8080/rewriteexample/

    (Just reload a few times in case a &JESSIONID=dfgd76fgdd6… is added to the links and breaks them, it will go away then *more weird jsf behaviour* -.-)


    GOOD POINT about oubound URLs being rewritten when they do not pass validation. That’s a very good point. I will add a test for this and make sure it gets fixed! Looking into your deployment issue…


    By the way, your application runs fine for me. Have you checked to make sure you don’t have any old or duplicate JARs on the classpath?



    Did you change the pom.xml to use 1.1.0? (Just to make sure)


    Yes I did :)



    Sorry, didnt have much time to revisit the problem until now. Maybe I didnt try your suggested reordering of the join clauses back then (or I did that and forgot one clause…), I really don’t know. However its now working, as long as I use the ordering join-path-to-where-matches instead of join-path-where-matches-to. Sorry for the trouble and thanks for your great support.


    Glad you got it working!

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

The forum ‘Rewrite Users’ is closed to new topics and replies.

Comments are closed.