I am new to JSF, I recently started working with a tutorial. I created the application in the same way as the information presented in the tutorial. However, when I start the server, I get the following error:
Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener java.lang.ClassCastException: com.sun.faces.config.WebConfiguration cannot be cast to com.sun.faces.config.WebConfiguration at com.sun.faces.config.WebConfiguration.getInstance(WebConfiguration.java:154) at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:145)
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" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>Hello, World</display-name> <description>Welcome to JavaServerFaces</description> <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>/faces/*</url-pattern> </servlet-mapping> <listener> <listener-class>com.sun.faces.config.ConfigureListener</listener-class> </listener> </web-app>
As stated in the tutorial, I added jsf-api and jsf-impl to Web-Inf / lib, but for Google, he found that jboss has its own version of jsf, which can pollute my application with several versions of jsf. If so, how can I solve the problem or if I am wrong, then what is the cause of the error?
Just add, since I think its jar conflit files I tried to add jar files imported from jboss from jboss-5.1.0.GA\server\default\deploy\jbossweb.sar\jsf-libs , all the same in vain.
Please, help.
source share