2012-03-14 165 views
0

當我在jboss 5.1中部署我的應用程序時,我遇到了一個大問題。當它開始,​​我得到這個:在JBoss 5.1中部署jsf應用程序時出錯

org.jboss.web.jsf.integration.config.JBossJSFConfigureListener 
com.sun.faces.config.ConfigurationException: It appears the JSP version of the container is older than 2.1 and unable to locate the EL RI expression factory, com.sun.el.ExpressionFactoryImpl. If not using JSP or the EL RI, make sure the context initialization parameter, com.sun.faces.expressionFactory, is properly set. 

我讀了很多關於這個bug的東西,並沒有爲我工作。

我的WEB-INF/lib中沒有jsf-api和jsf-impl。

這裏是我的web.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<web-app version="2.5" 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-app_2_5.xsd"> 
    <display-name>Personnes-Front</display-name> 
    <context-param> 
     <param-name>com.sun.faces.expressionFactory</param-name> 
     <param-value>org.jboss.el.ExpressionFactoryImpl</param-value> 
    </context-param> 
    <!-- Mojarra JSF --> 
    <context-param> 
     <param-name>com.sun.faces.numberOfViewsInSession</param-name> 
     <param-value>1</param-value> 
    </context-param> 
    <context-param> 
     <param-name>contextConfigLocation</param-name> 
     <param-value>classpath:net/blog/dev/front/applicationContext.xml 
     </param-value> 
    </context-param> 
    <context-param> 
     <param-name>facelets.BUFFER_SIZE</param-name> 
     <param-value>100000</param-value> 
    </context-param> 
    <context-param> 
     <param-name>facelets.DEVELOPMENT</param-name> 
     <param-value>false</param-value> 
    </context-param> 
    <context-param> 
     <param-name>facelets.REFRESH_PERIOD</param-name> 
     <param-value>0</param-value> 
    </context-param> 
    <!-- JSF --> 
    <context-param> 
     <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.DEFAULT_SUFFIX</param-name> 
     <param-value>.xhtml</param-value> 
    </context-param> 
    <context-param> 
     <param-name>javax.faces.STATE_SAVING_METHOD</param-name> 
     <param-value>server</param-value> 
    </context-param> 
    <!-- Facelets --> 
    <context-param> 
     <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name> 
     <param-value>com.sun.facelets.FaceletViewHandler</param-value> 
    </context-param> 
    <context-param> 
     <param-name>org.richfaces.SKIN</param-name> 
     <param-value>blueSky</param-value> 
    </context-param> 
    <listener> 
     <listener-class>org.springframework.web.context.ContextLoaderListener 
     </listener-class> 
    </listener> 
    <listener> 
     <listener-class>org.springframework.web.context.request.RequestContextListener 
     </listener-class> 
    </listener> 
    <listener> 
     <listener-class>org.springframework.web.util.IntrospectorCleanupListener 
     </listener-class> 
    </listener> 
    <!-- JSF --> 
    <listener> 
     <listener-class>com.sun.faces.config.ConfigureListener 
     </listener-class> 
    </listener> 
    <servlet> 
     <servlet-name>FacesServlet</servlet-name> 
     <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> 
     <load-on-startup>1</load-on-startup> 
    </servlet> 
    <servlet-mapping> 
     <servlet-name>FacesServlet</servlet-name> 
     <url-pattern>*.xhtml</url-pattern> 
    </servlet-mapping> 
    <!-- FILTERS --> 
    <!-- RichFaces --> 
    <filter> 
     <filter-name>richfaces</filter-name> 
     <filter-class>org.ajax4jsf.Filter</filter-class> 
    </filter> 
    <filter-mapping> 
     <filter-name>richfaces</filter-name> 
     <servlet-name>FacesServlet</servlet-name> 
    </filter-mapping> 

    <!-- Page par défaut --> 
    <welcome-file-list> 
     <welcome-file>private/personnesList.xhtml</welcome-file> 
    </welcome-file-list> 
</web-app> 

我不明白是什麼問題。

感謝您的幫助。

+0

你能詳細闡述一下你如何部署你的應用程序,你是否在使用jsf.deployer在jboss中使用jsf? – Rachel 2012-03-15 02:22:07

+0

我使用maven構建我的戰爭,並且我爲jsf-api和impl提供了一個範圍,因此它們不在最終的戰爭中。接下來,我將我的戰爭放在部署目錄中,並運行run.sh腳本來運行服務器。 – Kiva 2012-03-15 15:22:07

回答

0

我找到了解決方案。

Jboss 5.1附帶JSF 1.2.12,該版本似乎不適用於jboss el。

所以我在web.xml中添加此:

<context-param> 
     <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name> 
     <param-value>true</param-value> 
</context-param> 

而在我的pom.xml中,我還是傳統的JSF-API和JSF-implement執行和更新的版本(1.2.13對於爲例)我刪除了提供的範圍。

這場戰爭是部署這個自己的jsf版本,一切正常。

相關問題