加载FacesContextFactory时出错



我正在将我的应用程序从jsf 1.2迁移到2.0,并遵循此url迁移http://www.ibm.com/developerworks/rational/library/java-server-faces-migration/
但是当部署在weblogic服务器时,我面临以下问题

[HTTP:101216]Servlet: "Faces Servlet"在Web应用程序:" customer- Web "启动时预加载失败。java.lang.IllegalStateException:应用程序在启动时没有正确初始化,无法找到工厂:javax.faces.context.FacesContextFactory at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804) at javax.faces.FactoryFinder. getfactory (FactoryFinder.java:306) at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166) at weblogics .servlet.internal. stubsecurityhelper $ServletInitAction.run(StubSecurityHelper.java:283) at weblogics .security.acl.internal. authenticatedsubject . doas (AuthenticatedSubject.java:321) at在weblogic.servlet.internal.StubLifecycleHelper. createoneinstance (StubLifecycleHelper.java:58) at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:48) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:531) atweblogic.servlet.internal.WebAppServletContext.preloadServlet (WebAppServletContext.java: 1915) weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup (WebAppServletContext.java: 1889) weblogic.servlet.internal.WebAppServletContext.preloadResources (WebAppServletContext.java: 1807) weblogic.servlet.internal.WebAppServletContext.start (WebAppServletContext.java: 3045) weblogic.servlet.internal.WebAppModule.startContexts (WebAppModule.java: 1397)weblogic.application.internal.flow.ModuleStateDriver. nextstate (StateMachineDriver.java:83) at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119) at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200) atweblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java: 27) at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83) at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119) at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27) atweblogic.application.util . statemachinedriver . nextstate (StateMachineDriver.java:83) at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409) at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:54) at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161) at .next(BaseDeployment.java:1267) atweblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150) at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116) at . appcontainerinvoker .activate(AppContainerInvoker.java:79在weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253) at weblogic.deploy.internal.targetserver. deploymentmanager . handleccommit (DeploymentManager.java:440) atweblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181) at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12) atweblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

My web.xml is

    <?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
    version="2.5">
    <display-name>Customer Web</display-name>
    <!-- The master configuration file for this Spring web application -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
            /WEB-INF/config/web-application-config.xml
        </param-value>
    </context-param>
    <!-- Faces configuration -->
    <context-param>
        <param-name>javax.faces.application.CONFIG_FILES</param-name>
            <param-value>
                /WEB-INF/faces-config.xml,
                /WEB-INF/project-faces-config.xml
        </param-value>
    </context-param>    
    <!-- Tag libs for facelets -->
    <context-param>
       <param-name>facelets.LIBRARIES</param-name>
       <param-value>
           /WEB-INF/facelets.taglib.xml
       </param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
    </context-param>
    <!-- Enables special Facelets debug output during development -->
    <context-param>
        <param-name>facelets.DEVELOPMENT</param-name>
        <param-value>true</param-value>
    </context-param>
    <!-- Causes Facelets to refresh templates during development -->
    <context-param>
        <param-name>facelets.REFRESH_PERIOD</param-name>
        <param-value>1</param-value>
    </context-param>
    <!-- Enforce UTF-8 Character Encoding -->
    <filter>
        <filter-name>charEncodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>charEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <!-- Enables Spring Security -->
     <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter-mapping>
      <filter-name>springSecurityFilterChain</filter-name>
      <url-pattern>/*</url-pattern>
    </filter-mapping>
    <!-- Loads the Spring web application context -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <!-- <listener>   
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>   
</listener> --> 

    <!-- For spring-managed request- and session-scoped beans -->
    <listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>
    <!-- Serves static resource content from .jar files such as spring-faces.jar -->
    <servlet>
        <servlet-name>Resources Servlet</servlet-name>
        <servlet-class>org.springframework.js.resource.ResourceServlet</servlet-class>
        <load-on-startup>0</load-on-startup>
    </servlet>
    <!-- Map all /resources requests to the Resource Servlet for handling -->
    <servlet-mapping>
        <servlet-name>Resources Servlet</servlet-name>
        <url-pattern>/resources/*</url-pattern>
    </servlet-mapping>
    <!-- The front controller of this Spring Web application, responsible for handling all application requests -->
    <servlet>
        <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value></param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <!-- Map all /pages requests to the Dispatcher Servlet for handling -->
    <servlet-mapping>
        <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
        <url-pattern>/pages/*</url-pattern>
    </servlet-mapping>
    <!-- Just here so the JSF implementation can initialize, *not* used at runtime -->
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <!-- Just here so the JSF implementation can initialize -->
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
    </servlet-mapping>   
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>     
    </welcome-file-list>
    <error-page>
        <exception-type>java.lang.Exception</exception-type>
        <location>/pages/error</location>
    </error-page>
    <error-page>
       <error-code>403</error-code>
       <location>/pages/accessDenied</location>
    </error-page>
    <error-page>
       <error-code>500</error-code>
       <location>/pages/error</location>
    </error-page>
</web-app>

请检查JSF -api-2.x.y.jar(可能还有其他JSF 2.0依赖项)是否在CLASSPATH中

相关内容

  • 没有找到相关文章

最新更新