Board index JavaServer Faces General 2.2.1 to 3.0.M4 problems

2.2.1 to 3.0.M4 problems

Components, Ajax Framework, Utilities and More.

Post 12 Nov 2011, 01:01

Posts: 2
JSF 2.1
Mojarra 2.1.3
Tested on both GlassFish 3.1 and Tomcat 7.0.14

After switching from 2.2.1 to 3.0.M4 I have some new errors:
1.
org.primefaces.component.messages.Messages cannot be cast to org.primefaces.component.api.AutoUpdatable] with root cause
java.lang.ClassCastException: org.primefaces.component.messages.Messages cannot be cast to org.primefaces.component.api.AutoUpdatable

occurrs when:
<p:growl id="msgs" showDetail="true"  rendered="true" life="15000" />

or
  <p:messages id="msgs" showDetail="true" rendered="true" />

is definded.

2.
There is also :
javax.el.ELException: /templates/basic.xhtml: The class 'foo.beans.LoginBean' does not have the property 'login'.


  <p:commandButton value="Zaloguj" update="msgs,upload_form,loginLink"
                                     action="#{loginBean.login}"
                                     oncomplete="handleLoginRequest(xhr, status, args)"/>

when login is an method in bean.
Bean code:
@javax.faces.bean.ManagedBean(name = "loginBean")
@javax.faces.bean.SessionScoped
public class LoginBean implements Serializable {

    public LoginBean() {
        log.debug("LOGIN BEAN CREATED");
        loggedIn = false;
    }
    private Log log = LogFactory.getLog(this.getClass());
    private String username;
    private String password;
    private UserEntity userEntity = null;

    public UserEntity getUserEntity() {
        return userEntity;
    }
    private boolean loggedIn;

    public boolean isLoggedIn() {
        return loggedIn;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void login() {
        RequestContext context = RequestContext.getCurrentInstance();
        FacesMessage msg = null;
        try {
         ...
       }
      
       ...
}


full traces:
javax.el.ELException: /templates/basic.xhtml: The class 'foo.beans.LoginBean' does not have the property 'login'.
   at com.sun.faces.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:94)
   at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
   at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:302)
   at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185)
   at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129)
   at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
   at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
   at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
   at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
   at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
   at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
   at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
   at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:401)
   at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
   at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
   at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
   at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
   at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
   at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
   at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
   at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
   at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
   at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
   at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
   at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
   at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
   at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
   at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
   at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
   at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
   at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
   at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
   at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
   at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
   at java.lang.Thread.run(Thread.java:722)
   


and to previous problem:

org.primefaces.component.messages.Messages cannot be cast to org.primefaces.component.api.AutoUpdatable] with root cause
java.lang.ClassCastException: org.primefaces.component.messages.Messages cannot be cast to org.primefaces.component.api.AutoUpdatable
   at org.primefaces.event.AutoUpdateComponentListener.processEvent(AutoUpdateComponentListener.java:30)
   at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
   at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2129)
   at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2105)
   at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:293)
   at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:244)
   at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2197)
   at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2202)
   at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2202)
   at javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1883)
   at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:400)
   at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2631)
   at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2603)
   at com.sun.faces.facelets.tag.jsf.ComponentSupport.addComponent(ComponentSupport.java:559)
   at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.addComponentToView(ComponentTagHandlerDelegateImpl.java:290)
   at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:204)
   at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
   at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
   at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
   at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
   at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
   at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
   at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
   at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
   at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
   at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:155)
   at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
   at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
   at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
   at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:769)
   at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
   at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
   at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:410)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:317)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:204)
   at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
   at java.lang.Thread.run(Thread.java:722)

Post 12 Nov 2011, 02:19
tandraschko PrimeFaces Core Developer

Posts: 2175
Location: Bavaria, DE

Check your classpath, you have multiple primefaces libs
Always Bet On Prime (+ Extensions)!

PrimeFaces Extensions: https://github.com/primefaces-extensions
OpenWebBeans: http://openwebbeans.apache.org/
DeltaSpike: http://deltaspike.apache.org/
Personal Blog: http://tandraschko.blogspot.de/

Post 12 Nov 2011, 03:38

Posts: 122
Also ensure that you completely delete the old deployment directory under your tomcat / catalina home. Sometimes jars get left behind.
-------
PrimeFaces 3.4, Glassfish 3.1.2, Mojarra 2.1.6

Post 13 Nov 2011, 03:09

Posts: 2
I have tried 3.0.M1 and 3.0.M2 - all seems to work (some problems with not found id's) there is a new upload component, but when I'm trying to upload file nothing happens.
When I try 3.0.M3 or 3.0.M4 one on previously described error occurs.
I have tried Tomcat's and web application's lib folder, and there is no duplicated Prime Faces library.

Post 13 Nov 2011, 11:40
tandraschko PrimeFaces Core Developer

Posts: 2175
Location: Bavaria, DE

zoigl wrote:
Check your classpath, you have multiple primefaces libs
Always Bet On Prime (+ Extensions)!

PrimeFaces Extensions: https://github.com/primefaces-extensions
OpenWebBeans: http://openwebbeans.apache.org/
DeltaSpike: http://deltaspike.apache.org/
Personal Blog: http://tandraschko.blogspot.de/

Post 15 Nov 2011, 06:01

Posts: 5
I have the same issue here :cry:

Post 15 Nov 2011, 15:24

Posts: 5
If you are using maven, remove the application is not enough you need to do a mvn clean

This solved the problem :D

Post 30 Jan 2012, 17:19

Posts: 11
I am using 2.2.1 in my application and implemented <p:orderlist> by using 3.0.1 but when I run my GUI it throughs

java.lang.ClassCastException: org.primefaces.component.messages.Messages cannot be cast to org.primefaces.component.api.AutoUpdatable

I want to use both version of primefaces as I cannot change namespace for all the .xhtml pages.

Post 30 Jan 2012, 17:20

Posts: 15050
Location: Cybertron

You don't need to do it manually, do a find&replace.
PrimeFaces Lead

Post 30 Jan 2012, 17:31

Posts: 11
Yes we can do find and replace I have tried the newer version in which I am facing issue almost at every page like <p:command>
button is not working as it has issue in navigation and in datatable it also requires rowkey for datatable.

Next

Return to General