2012-08-24 2 views
1

Для простого JSF 2.0 и Tomcat 7 приложения я получаю следующее сообщение об ошибке:ClassCastException: UIViewRoot не может быть приведен к org.portletfaces.bridge.component.PortletNamingContainerUIViewRoot

Casting Error java.lang.ClassCastException: javax.faces.component.UIViewRoot cannot be cast to org.portletfaces.bridge.component.PortletNamingContainerUIViewRoot

Aug 24, 2012 11:55:40 AM com.sun.faces.application.view.FaceletViewHandlingStrategy  handleRenderException 
SEVERE: Error Rendering View[/hello.xhtml] 
java.lang.ClassCastException: javax.faces.component.UIViewRoot cannot be cast to org.portletfaces.bridge.component.PortletNamingContainerUIViewRoot 
at org.portletfaces.bridge.renderkit.html_basic.HeadRenderer.encodeBegin(HeadRenderer.java:62) 
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:823) 
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1611) 
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616) 
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrateg  y.java:380) 

hello.xhtml выглядит следующим образом :

 <?xml version="1.0" encoding="UTF-8"?> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:f="http://java.sun.com/jsf/core"  
    xmlns:h="http://java.sun.com/jsf/html"> 

<h:body> 

    <h:form> 
     <h:commandButton value="Welcome Me" action="welcome"></h:commandButton> 
    </h:form> 
</h:body> 
    </html> 

ответ

0

У меня также есть та же проблема. Но как только h: head или h: body удаляется, страница загружается нормально, за исключением javascripts и css, для которых требуется h: head. Они не будут загружены.

Смежные вопросы