我是JSF的新手,我最近開始使用教程。我完全按照教程中提供的信息創建了應用程序。然而,當我啓動服務器,我收到以下錯誤:在Jboss 5.0上啓動JSF應用程序時出錯
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>
如教程表明我已經添加了JSF的API和JSF的IMPL在WEB-INF/lib,但是同樣的谷歌搜索,我發現jboss有它自己的jsf版本,這可能是污染我的應用程序與多個jsf版本。如果是這樣的話,我該如何解決這個問題,或者如果我錯了,那麼錯誤背後的原因是什麼?
只是添加,因爲我相信它的jar文件conflit我試圖添加與jboss從jboss-5.1.0.GA\server\default\deploy\jbossweb.sar\jsf-libs
導入的jar文件,仍然是徒勞。
請幫忙。
你可以發佈web.xml嗎? – Thihara 2013-04-11 05:50:08
最初,我沒有在web.xml中的任何監聽器,但在提供的後http://stackoverflow.com/questions/2558614/jsf-web-application-with-icefaces-compaonent我已經添加它試圖解決問題。 – Viplove 2013-04-11 05:54:33