ELResolver cannot handle a null base Object

Splash Forums PrettyFaces Users ELResolver cannot handle a null base Object

This topic contains 4 replies, has 2 voices, and was last updated by  Domen91 2 years, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #25688

    Domen91
    Participant

    Hello,

    I have problem with simple rewrite rule.

    I have only ths code and XHTML file (attached).

    @ELBeanName(value = "test")
    @ManagedBean(name = "test")
    @RequestScoped
    @Join(path = "/test/{p}", to = "/test.xhtml")
    public class FilesPostalItem implements Serializable {
        @Parameter("p")
        private String p;
        
        public String getP() {
            return p;
        }
    
        public void setP(String p) {
            this.p = p;
        }
    
        public void test1(ActionEvent event) {
            System.out.println("TEST - " + p);
        }
    }

    But when I visit page localhost:8080/App/test/myString I get error:

    19:30:10,129 ERROR [io.undertow.request] (default task-5) UT005023: Exception handling request to /Meteor/test/mystring: javax.servlet.ServletException: Error during Rewrite processing. Please inspect stack trace for root cause.

    Caused by: javax.el.PropertyNotFoundException: ELResolver cannot handle a null base Object with identifier ‘test’

    Where am I screwed?
    I use:
    rewrite-servlet-2.0.9.Final.jar
    rewrite-integration-faces-2.0.9.Final.jar
    rewrite-integration-cdi-2.0.9.Final.jar

    Tnx,
    Domen

    • This topic was modified 2 years, 7 months ago by  Domen91.
    • This topic was modified 2 years, 7 months ago by  Domen91.
    #25707

    It looks like the CdiExpressionLanguageProvider tries to evaluate the expression although you are using a JSF managed bean. Could you try to either:

    • Use a CDI managed bean instead (preferred)
    • Remove the integration-cdi module from your project
    #25716

    Domen91
    Participant

    Yes it’s works if remove faces module and use CDI.
    But if I remove CDI module and use managed beans then I get next error (I have the entire application built on ManagedBean and do not want to rewrite code, yet 🙂 ):

    
    16:03:20,358 ERROR [io.undertow.request] (default task-19) UT005023: Exception handling request to /Meteor/test/a: javax.servlet.ServletException: Error during Rewrite processing. Please inspect stack trace for root cause.
    ...
    Caused by: java.lang.IllegalArgumentException: FacesContext.getCurrentInstance() returned null. EL expressions can only be evaluated in the JSF lifecycle. You should use PhaseAction and PhaseBinding to perform a deferred operation instead.
    

    Tnx,
    Domen

    #25717

    If your are using the rewrite-integration-faces module, you will have to add @Deferred to your parameter:

    @Parameter("p")
    @Deferred
    private String p;
    

    This will defer the binding of the parameter to JSF lifecycle.

    #25718

    Domen91
    Participant

    Thank you very much.
    It works. I don’t know what I was doing yesterday, because I also tested with @Deferred (after posted here).

    I have another problem with file upload and form action url.
    I upload PDF with tests.

    File upload in WildFly CR1 works only with CDI module and only when I have @Join with parameters and file accessible to the outside.

    Is this bug in rewrite module, WidlFly, Mojarra, PrimeFaces?

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

You must be logged in to reply to this topic.

Comments are closed.