2.2.1 to 3.0.M4 problems

UI Components for JSF
featon
Posts: 2
Joined: 12 Nov 2011, 00:36

12 Nov 2011, 01:01

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.

Code: Select all

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:

Code: Select all

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

Code: Select all

  <p:messages id="msgs" showDetail="true" rendered="true" />
is definded.

2.
There is also :

Code: Select all

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

Code: Select all

  <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:

Code: Select all

@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:

Code: Select all

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:

Code: Select all

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)

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

12 Nov 2011, 02:19

Check your classpath, you have multiple primefaces libs
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

porthos
Posts: 122
Joined: 09 May 2011, 03:17

12 Nov 2011, 03:38

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

featon
Posts: 2
Joined: 12 Nov 2011, 00:36

13 Nov 2011, 03:09

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.

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

13 Nov 2011, 11:40

zoigl wrote:Check your classpath, you have multiple primefaces libs
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

giovanni
Posts: 5
Joined: 15 Nov 2011, 05:57

15 Nov 2011, 06:01

I have the same issue here :cry:

giovanni
Posts: 5
Joined: 15 Nov 2011, 05:57

15 Nov 2011, 15:24

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

This solved the problem :D

JhonPF
Posts: 11
Joined: 16 May 2011, 11:17

30 Jan 2012, 17:19

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.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

30 Jan 2012, 17:20

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

JhonPF
Posts: 11
Joined: 16 May 2011, 11:17

30 Jan 2012, 17:31

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.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 20 guests