开发者

p:button leads to ClassCastException

I use Primefaces 2.2 together with Spring 3.0.5 and it is working pretty good so far but today I ran into the following problem. I wanted to include the p:button component but when I do that I get the following exception:

java.lang.ClassCastException: org.primefaces.optimus.navigationhandler.ViewIdBasedNavigationHandler cannot be cast to javax.faces.application.ConfigurableNavi开发者_高级运维gationHandler
    at org.primefaces.component.button.ButtonRenderer.findNavigationCase(ButtonRenderer.java:114)
    at org.primefaces.component.button.ButtonRenderer.buildOnclick(ButtonRenderer.java:90)
    at org.primefaces.component.button.ButtonRenderer.encodeMarkup(ButtonRenderer.java:56)
    at org.primefaces.component.button.ButtonRenderer.encodeEnd(ButtonRenderer.java:38)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:879)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1650)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1646)
    at ...

The ViewIdBasedNavigationHandler is configured in my faces-config.xml and all other primefaces components have been working so far. As far as I see the ViewIdBasedNavigationHandler class is derived from javax.faces.application.NavigationHandler and not from javax.faces.application.ConfigurableNavigationHandler so the ClassCastException makes sense. But due to the fact that I cannot find other users having the same problem I guess I am missing something.

Any ideas? Jens


You don't need ViewIdBasedNavigationHandler, I suggest removing it or old optimus project if you have it. JSF 2.0 has view id based implicit navigation built-in.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜