得到错误"应用程序在启动时未正确初始化,找不到Factory:javax.faces.context.FacesContextFactory"

时间:2016-04-05 10:40:17

标签: java jsf weblogic icefaces

当我尝试在weblogic服务器上部署我的应用程序时,我收到了主题错误。我尝试了提供给其他类似问题的答案,但它没有解决我的错误。

请让我知道我做错了什么。

我的 web.xml

<web-app version="2.4" 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_4.xsd">

    <display-name>FedEx Location Services</display-name>
    <description>
    </description>

    <!-- Facelets composite component definitions. -->
    <context-param>
        <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
        <param-value>/WEB-INF/includes/components/comp.taglib.xml
        </param-value>
    </context-param>
    <context-param>
        <param-name>com.icesoft.faces.connectionTimeout</param-name>
        <param-value>1800000</param-value>
    </context-param>

    <context-param>
        <param-name>com.sun.faces.responseBufferSize</param-name>
        <param-value>500000</param-value>
    </context-param>
    <context-param>
      <param-name>javax.faces.FACELETS_BUFFER_SIZE</param-name>
      <param-value>500000</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>org.icefaces.compressResources</param-name>
        <param-value>true</param-value>
    </context-param>

    <context-param>
        <param-name>org.icefaces.ace.theme</param-name>
        <param-value>none</param-value>
    </context-param>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml, /WEB-INF/BOContext.xml
        </param-value>
    </context-param>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener> 

    <listener>
         <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener> 

    <!-- file upload Servlet -->
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.faces.enableMissingResourceLibraryDetection
        </param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Production</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.VALIDATE_EMPTY_FIELDS</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>com.icesoft.faces.synchronousUpdate</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>org.icefaces.connectionLostRedirectURI</param-name>
        <param-value>'logout.jsp?requestFrom=connectionLost'</param-value>
    </context-param>
    <context-param>
        <param-name>org.icefaces.sessionExpiredRedirectURI</param-name>
        <param-value>'logout.jsp?requestFrom=SessionExpired'</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.faces.externalizeJavaScript</param-name>
        <param-value>true</param-value>
    </context-param>

    <context-param>
        <param-name>org.icefaces.fastBusyIndicator</param-name>
        <param-value>true</param-value>
    </context-param>

    <servlet>
        <servlet-name>DownloadServlet</servlet-name>
        <servlet-class>com.fedex.itrigger.common.DownloadServlet
        </servlet-class>
    </servlet>

    <servlet>
        <servlet-name>Resource Servlet</servlet-name>
        <servlet-class>com.icesoft.faces.webapp.CompatResourceServlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>Startup Servlet</servlet-name>
        <servlet-class>com.fedex.itrigger.common.StartupServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/icefaces/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>Resource Servlet</servlet-name>
        <url-pattern>/xmlhttp/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>DownloadServlet</servlet-name>
        <url-pattern>/pages/download/DownloadServlet</url-pattern>
    </servlet-mapping>

    <session-config>
        <session-timeout>60</session-timeout>
    </session-config>

    <!-- Welcome files -->
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <mime-mapping>
        <extension>png</extension>
        <mime-type>image/png</mime-type>
    </mime-mapping>
    <mime-mapping>
        <extension>xml</extension>
        <mime-type>application/xml</mime-type>
    </mime-mapping>


    <filter>
        <filter-name>OpenSessionInViewFilter</filter-name>
        <filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter
        </filter-class>
        <init-param>
            <param-name>sessionFactoryBeanName</param-name>
            <param-value>sessionFactory</param-value>
        </init-param>
        <init-param>
            <param-name>flushMode</param-name>
            <param-value>AUTO</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>OpenSessionInViewFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

我的 weblogic-application.xml

<prefer-application-packages>
        <package-name>antlr.*</package-name>
        <package-name>javax.faces.*</package-name>
        <package-name>com.sun.faces.*</package-name>
        <package-name>com.bea.faces.*</package-name>
    </prefer-application-packages>
    <prefer-application-resources>
        <resource-name>javax.faces.*</resource-name>
        <resource-name>com.sun.faces.*</resource-name>
        <resource-name>com.bea.faces.*</resource-name>
        <resource-name>META-INF/services/javax.servlet.ServletContainerInitializer</resource-name>
        <resource-name>META-INF/services/com.sun.faces.spi.FacesConfigResourceProvider</resource-name>
    </prefer-application-resources>
</weblogic-application>

控制台错误

WARNING: ICEpush library missing. Push notification disabled.
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
<Apr 5, 2016 10:37:45 AM GMT> <Error> <javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Critical error during deployment:
java.lang.NoSuchMethodError: org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar([Lorg/apache/xerces/xni/parser/XMLInputSource;)V
        at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)
        at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:591)
        at com.sun.faces.config.DbfFactory.initStatics(DbfFactory.java:248)
        at com.sun.faces.config.DbfFactory.<clinit>(DbfFactory.java:208)
        at com.sun.faces.config.ConfigManager$ParseTask.<init>(ConfigManager.java:890)
        Truncated. see log file for complete stacktrace
>
<Apr 5, 2016 10:37:45 AM GMT> <Warning> <HTTP> <BEA-101162> <User defined listener com.sun.faces.config.ConfigureListener failed: java.lang.RuntimeException: java.lang.NoSuchMethodError: org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar([Lorg/apache/xerces/xni/parser/XMLInputSource;)V.
java.lang.RuntimeException: java.lang.NoSuchMethodError: org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar([Lorg/apache/xerces/xni/parser/XMLInputSource;)V
        at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
        at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:661)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
        Truncated. see log file for complete stacktrace
Caused By: java.lang.NoSuchMethodError: org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar([Lorg/apache/xerces/xni/parser/XMLInputSource;)V
        at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)
        at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:591)
        at com.sun.faces.config.DbfFactory.initStatics(DbfFactory.java:248)
        at com.sun.faces.config.DbfFactory.<clinit>(DbfFactory.java:208)
        at com.sun.faces.config.ConfigManager$ParseTask.<init>(ConfigManager.java:890)
        Truncated. see log file for complete stacktrace
>
<Apr 5, 2016 10:37:45 AM GMT> <Error> <javax.faces> <BEA-000000> <Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory. Attempting to find backup.>
<Apr 5, 2016 10:37:45 AM GMT> <Error> <HTTP> <BEA-101216> <Servlet: "Faces Servlet" failed to preload on startup in Web application: "/imktApp/iTrigger".
java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory.
        at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1008)
        at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343)
        at javax.faces.webapp.FacesServlet.init(FacesServlet.java:302)
        at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:337)
        at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:288)
        Truncated. see log file for complete stacktrace
>
<Apr 5, 2016 10:37:45 AM GMT> <Error> <javax.faces> <BEA-000000> <Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory. Attempting to find backup.>
<Apr 5, 2016 10:37:45 AM GMT> <Error> <javax.enterprise.resource.webcontainer.jsf.config> <BEA-000000> <Unexpected exception when attempting to tear down the Mojarra runtime
java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.
        at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1008)
        at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343)
        at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:131)
        at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:328)
        at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:662)
        Truncated. see log file for complete stacktrace
>
<Apr 5, 2016 10:37:45 AM GMT> <Error> <Deployer> <BEA-149231> <Unable to set the activation state to true for the application "iTrigger".
weblogic.application.ModuleException: java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory.
        at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
        at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
        at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
        Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory.
        at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1008)
        at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343)
        at javax.faces.webapp.FacesServlet.init(FacesServlet.java:302)
        at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:337)
        at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:288)
        Truncated. see log file for complete stacktrace

0 个答案:

没有答案