No registered org.ocpsoft.rewrite.el.spi.ExpressionLanguageProvider could handle

Splash Forums Rewrite Users No registered org.ocpsoft.rewrite.el.spi.ExpressionLanguageProvider could handle

This topic contains 8 replies, has 3 voices, and was last updated by  Christian Kaltepoth 8 years, 5 months ago.

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


    I’m using tomcat-6.0.36, mojarra-2.1.24, rewrite-servlet-2.0.5.Final, rewrite-integration-cdi-2.0.5.Final, weld-servlet-1.0.1-Final
    Bean code:

    @Join(path = "/test/{name}", to = "/test.faces")
    public class TestBean {
        private String name;
        public String getName() {
            return name;
        public void setName(String name) {
   = name;

    Page code:

    <!DOCTYPE html
            PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    <html xmlns=""
        <title>Simple JSF Facelets page</title>
            <h:outputText value="Hello #{}"/>

    When i open http://localhost:8080/test/kit, i see:

    javax.servlet.ServletException: Error during Rewrite processing. Please inspect stack trace for root cause.

    root cause

    org.ocpsoft.rewrite.exception.RewriteException: No registered org.ocpsoft.rewrite.el.spi.ExpressionLanguageProvider could handle the Expression []

    and in tomcat.log:

    Caused by: java.lang.NoSuchMethodError: javax.el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory;
    	at org.ocpsoft.rewrite.cdi.expressions.ExpressionFactoryProducer.createExpressionFactory(
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    	at java.lang.reflect.Method.invoke(
    	at org.jboss.weld.util.reflection.SecureReflections$
    	at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(
    	at org.jboss.weld.util.reflection.SecureReflections.invoke(
    	at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(
    	at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(
    	... 30 more

    Is it because of tomcat-6’s EL implementation? Could this be working on tomcat-6?



    With tomcat-7 everything is working.
    But with @RequestScoped bean is creating twice, first when Rewrite sets parameter, second when field requested from page. So everytime we see empty string on the page. When i changed @RequestScoped to @ConversationScoped, it started to work as expected. I cannt understand difference between request and conversation scope.


    Hi there Antonu,

    Sorry for the late reply. I’ve been on vacation and we had a problem with our forum’s notification emails recently.

    To begin to attempt to answer this question, I believe you are correct that Tomcat 6 probably bundles a version of the ExpressionFactory that is incompatible with Rewrite. We reference the EL2.2 specification API in our integration-cdi module, so if Tomcat 6 does not supply that API, this could cause problems. This class is responsible for creating the provider.

    package org.ocpsoft.rewrite.cdi.expressions;
    import javax.el.ExpressionFactory;
    import javax.enterprise.context.ApplicationScoped;
    import javax.enterprise.inject.Produces;
    import javax.enterprise.inject.spi.BeanManager;
     * Responsible for producing the {@link ExpressionFactory}
     * @author Stuart Douglas
     * @author Pete Muir
    class ExpressionFactoryProducer {
        ExpressionFactory createExpressionFactory(BeanManager beanManager) {
            return beanManager.wrapExpressionFactory(ExpressionFactory.newInstance());

    I believe that CDI actually requires this version of the API to use some features of EL, but I could be wrong. What happens if you try to include an EL implementation of your own? I believe this S.O. question provides a solution –

    I hope this helps!



    Hello Lincoln Baxter III!
    Thank you for response. This is really beacuse of EL-2.1 in Tomcat-6. With EL-2.2 its working.
    Can you help me understand why @RequestScoped named bean is instantiating twice, and paramenter data is loosing?

    UPD. I think this should be another topic, my bad.

    • This reply was modified 8 years, 5 months ago by  antonu17. Reason: update

    Are you using the JSF request scope or the CDI request scope annotation?



    I’m using CDI request scope annotation


    How do you know that your bean is created twice? Do you have a log statement in your constructor? If so, don’t do that. CDI creates proxy classes for request scoped beans. These proxies are created by subclassing your bean. When an instance of this proxy is created, your constructor will also be executed. That’s why you see constructor calls twice. One for the proxy, one for the real bean. You typically shouldn’t use constructors for your managed bean. Instead, use @PostConstruct for initialization.



    I’m using intellij idea dbugger. I just set breakpoint in getName() and setName() of TestBean class. Setter is invoking and sets name string, but when getter is invoking – name contains null, and address of TestBean instance in debuuger is different from address of when it was in setter.

    i’ve made a another one test with debbuger while writing this reply, and now it working as axpected. the same TestBean instance in both getter and setter invokings. i don’t know why is wasn;t so before. anyway, question is closed, sorry for bothering you.


    Nice to hear you solved your problem. 🙂

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

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

Comments are closed.