在JBoss 5.1中部署jsf应用程序时出错

时间:2012-03-14 22:16:56

标签: jsf jboss5.x

当我在jboss 5.1中部署我的应用程序时,我遇到了一个大问题。当它开始时,我明白了:

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>

我不明白这是什么问题。

感谢您的帮助。

1 个答案:

答案 0 :(得分: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-impl修复了一个较新的版本(例如1.2.13),我删除了提供的范围。

使用这个自己的jsf版本部署战争,一切正常。

相关问题