Rewrite doesn't read org.ocpsoft.rewrite.config.ConfigurationProvider

Splash Forums Rewrite Users Rewrite doesn't read org.ocpsoft.rewrite.config.ConfigurationProvider

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

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #18428


    Hello Linkoln, Christian, I was trying to use Rewrite in my JSF app, but for some reason Rewrite is not reading my /META-INF/services/org.ocpsoft.rewrite.config.ConfigurationProvider file, my project structure is:


    I put the same code inside of JSFCore to test, but this worked when I modified the file path “META-INF/services” to “../../META-INF/services” in ‘ServiceLoader’, can you explain me this?

    I’m using:


    JSF 2.1

    Rewrite 1.0.5

    CDI, Primefaces


    You have put the services file at the wrong location. It must be located at:


    I know the location of META-INF for webapps is a bit confusing. You are right that there is usually also a META-INF directory in the root of the webapp archive, but that’s a location where containers expect custom configuration files or other stuff. The META-INF folder in WEB-INF/classes instead is accessible from the classpath just like the corresponding files in JAR files. And ServiceLoader mechanism Rewrite uses requires the files to be on the classpath.

    BTW: If you are using CDI for you webapp, you won’t have to add the services file at all for Rewrite to find your ConfigurationProvider. Just include the CDI integration module of Rewrite and Rewrite will automatically find ConfigurationProvider implementations which are managed by the CDI container. :)



    wow… your explaining was useful. I going to use the CDI integration module, so easy… Thank you Christian… =)



    Can you correct the documentation on this? I’ve fallen into the same trap because mention the path is /META-INF/services/org.ocpsoft.rewrite.config.ConfigurationProvider instead of /WEB-INF/classes/META-INF/services/org.ocpsoft.rewrite.config.ConfigurationProvider.

    Mentioning that you don’t need explicit ConfigurationProvider registration when you have CDI would also be a great help.

    Thank you


    I’ve updated the documentation. Thanks for pointing out that this is confusing! Do you find the new language clearer?



    thanks for the feedback. The quickstart guide on already mentions this issue. Perhaps it has been added recently? I don’t know.

    We are currently working on the Rewrite documentation, which will be available here:

    But this is still work in progress. 🙂


    Ups. Concurrent posts. 🙂


    Yep 😛 I just updated it. Hehe.

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

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

Comments are closed.