简体   繁体   中英

java.lang.ClassCastException: com.sun.facelets.component.RepeatRenderer cannot be cast to javax.faces.render.Renderer

Tried so many ways but still i am getting "java.lang.ClassCastException: com.sun.facelets.component.RepeatRenderer cannot be cast to javax.faces.render.Rendere"

Below is the code web.xml

 <?xml version="1.0" encoding="UTF-8"?>
 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>something</display-name>
<welcome-file-list>
    <welcome-file>index.xhtml</welcome-file>
</welcome-file-list>



<context-param>
    <description />
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>

<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>


<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
</servlet-mapping>
</web-app>

faces.xml

   <?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
 <managed-bean>
    <managed-bean-name>zendeskVoiceDashboard</managed-bean-name>
    <managed-bean-class>com.tn.gov.zendesk.ZendeskVoiceDashboard</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>        
</managed-bean>
 </faces-config>

Jar's used

activation-1.1
antlr-2.7.7
c3p0-0.9.1.1
commons-collections-3.2
commons-io-2.4
commons-logging-1.1.1
commons-pool-1.5.3
dom4j-1.6.1
hibernate-annotations
hibernate-commons-annotations-4.0.4.Final
 hibernate-core-4.3.1.Final
 hibernate-entitymanager-4.3.1.Final
 hibernate-jpa-2.0-api-1.0.1.Final
javassist-3.18.1-GA
 javax.json-1.0
 jsf-api
 jsf-impl
 json-20090211
 jstl-1.2
  jta-1.1
  jxl-2.6.12
  log4j-1.2.16
  mail-1.4
  netty-3.9.2.Final
   ojdbc6
  org-apache-commons-codec
   primefaces-3.4
   quartz-2.2.1
    slf4j-simple-1.6.1

The com.sun.facelets.* package identifies Facelets 1.x, which is a legacy standalone library intented to replace JSP in legacy JSF 1.x. Since JSF 2.x, Facelets was repackaged as part of JSF implementation in com.sun.faces.facelets.* package in jsf-impl.jar (and since Mojarra 2.1.6 javax.faces.jar ).

Unfortunately you left out the stack trace entirely which usually contains a lot more clues, but provided that you're indeed actually using JSF 2.x, as indicated by your faces-config.xml root declaration, then that can only mean that your runtime classpath is polluted with a Facelets 1.x library, usually named facelets.jar .

If you remove it, this problem should disappear. It's not listed in your JAR list, but the exception tells otherwise.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM