1

Background:

I'm using the below two classes (Search.java and SearchBean.java) in a Primefaces web application (version 2.2.1). All of my classes in the com.actions package are request scoped beans that handle the business logic in my application (actionListeners, Listeners, etc). The classes in the com.beans package are all session scoped beans that maintain state about the application. Each request scoped has an instance of a session scoped bean injected using CDI and each are managed by Spring.

Issue:

When I upgraded to 3.0.1 the classes are not getting registered by Primefaces and I get an error message like Property 'test' not found on type com.actions.Search. This happens on every single method that's mapped from a Primefaces component to either the request or session beans below. Any ideas on what are the appropriate changes?

Exception:

javax.el.ELException: /WEB-INF/facelet/components/test.xhtml: Property 'process' not found on type com.actions.Search
com.sun.faces.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:94)
    com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
    com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:183)
    javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
    javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:853)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
    com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:399)
    com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
    org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
    org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:115)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    com.dc.api.service.impl.CacheControlFilter.doFilter(CacheControlFilter.java:31)
    com.dc.api.service.impl.HttpsCookieFilter.doFilter(HttpsCookieFilter.java:46)

Class that handles business logic and holds an instance of a session scoped bean

package com.actions;

import javax.inject.Inject;
import javax.inject.Named;
import org.springframework.context.annotation.Scope;
import com.beans.SearchBean;

@Named
@Scope("request")
public class Search{
    @Inject
    private SearchBean searchBean;

    public void process() { 
        //business logic here
        searchBean.get...
    }
}

Bean that maintains data in session state

package com.beans;

import javax.inject.Named;
import org.springframework.context.annotation.Scope;

@Named
@Scope("session")
public class SearchBean {
    private String text="test";
    //getters and setters
}

The below alternate approach also is not working (just using one bean):

package com.actions;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@Scope("session")
public class Search {

    public void sessionIdleListener() { 
    }
}
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
c12
  • 9,557
  • 48
  • 157
  • 253
  • can you please confirm you are adhering to proper getter/setter for java bean properties have a look @ [link](http://stackoverflow.com/questions/8577545/javax-el-propertynotfoundexception-property-answer-not-found-on-type-com-pool) – baba.kabira Jan 27 '12 at 06:00
  • @gbagga - yeah it does. All I changed was the version of Primefaces. – c12 Jan 27 '12 at 07:07
  • can you check differences in tag currently being used by you from primefaces may be a property of tag was present in version 2 but not in version 3 – baba.kabira Jan 27 '12 at 07:41
  • the problem was the namespace for the Primefaces tags was changed – c12 Jan 28 '12 at 01:23

1 Answers1

2

The issue was resolved by providing the new Primefaces 3.0.1 namespace of xmlns:p="http://primefaces.org/ui" as it had changed from the former version of xmlns:p="http://primefaces.prime.com.tr/ui"

c12
  • 9,557
  • 48
  • 157
  • 253