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() {
}
}