简体   繁体   English

weblogic java.lang.IllegalStateException:找不到工厂javax.faces.context.FacesContextFactory的备份。

[英]weblogic java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory.

I have an application in java faces that work properly with Tomcat 7 with the follow web.xml. 我有一个Java Face中的应用程序,可以通过以下web.xml在Tomcat 7中正常使用。

<?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_3_0.xsd" id="WebApp_ID" version="3.0">
    <display-name>spfilesharing</display-name>
    <welcome-file-list>
        <welcome-file>index.xhtml</welcome-file>
    </welcome-file-list>
    <servlet>
        <servlet-name>GetIAMToken</servlet-name>
        <servlet-class>pt.ptinovacao.personal.spfilesharing.authentication.GetIAMToken</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>GetIAMToken</servlet-name>
        <url-pattern>/getIAMToken</url-pattern>
    </servlet-mapping>
    <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>*.xhtml</url-pattern>
    </servlet-mapping>
    <context-param>
        <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>
    <context-param>
        <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
        <param-value>resources.application</param-value>
    </context-param>
    <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
    <filter>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    <context-param>
        <param-name>primefaces.THEME</param-name>
        <param-value>bootstrap</param-value>
    </context-param>
</web-app>

To deploy the aplication in weblogic i am using a ear project with the follow weblogic-application.xml. 为了在Weblogic中部署应用程序,我正在使用带有以下weblogic-application.xml的ear项目。

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-application xmlns="http://xmlns.oracle.com/weblogic/weblogic-application" 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/javaee_5.xsd http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.0/weblogic-application.xsd" >
    <prefer-application-packages>
        <package-name>org.opensaml.*</package-name>
        <package-name>org.slf4j.*</package-name>
        <package-name>javax.faces.*</package-name> 
        <package-name>com.sun.faces.*</package-name> 
        <package-name>org.apache.myfaces.*</package-name> 
    </prefer-application-packages> 

    <prefer-application-resources> 
        <resource-name>javax.faces.*</resource-name> 
        <resource-name>com.sun.faces.*</resource-name> 

        <resource-name>META-INF/services/javax.servlet.ServletContainerInitializer</resource-name>
    </prefer-application-resources>

</weblogic-application>

When I run it in weblogic I'm getting the following error: 当我在weblogic中运行它时,出现以下错误:

java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory. 
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1010)
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:342)
    at javax.faces.webapp.FacesServlet.init(FacesServlet.java:302)
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:299)
    at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:250)
    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)
    at weblogic.servlet.internal.StubSecurityHelper.initServletInstance(StubSecurityHelper.java:94)
    at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:82)
    at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:74)
    at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:60)
    at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:34)
    at weblogic.servlet.internal.ServletStubImpl.initStubLifecycleHelper(ServletStubImpl.java:624)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:565)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:281)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:74)
    at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:74)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:74)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3288)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3254)
    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)
    at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2163)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2089)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2074)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1513)
    at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

Does anyone know how to fix it? 有谁知道如何修理它?

I have changed the weblogic-application.xml of the ear project to: 我已将ear项目的weblogic-application.xml更改为:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-application xmlns="http://xmlns.oracle.com/weblogic/weblogic-application" 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/javaee_5.xsd http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.0/weblogic-application.xsd" >
    <prefer-application-packages>
        <package-name>org.opensaml.*</package-name>
        <package-name>org.slf4j.*</package-name>
    </prefer-application-packages> 
</weblogic-application>

And now it's working. 现在它正在工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 javax.faces.context.FacesContextFactory。 试图找到备份 - javax.faces.context.FacesContextFactory. Attempting to find backup “IllegalStateException:无法在 arquillian 中找到工厂 javax.faces.context.FacesContextFactory 的备份” - “IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory” in arquillian 找不到工厂:javax.faces.context.FacesContextFactory问题 - Could not find Factory: javax.faces.context.FacesContextFactory problem 我收到此错误:找不到工厂:javax.faces.context.FacesContextFactory - I am getting this error: could not find Factory: javax.faces.context.FacesContextFactory java.lang.NoClassDefFoundError: javax/faces/context/FacesContextFactory - java.lang.NoClassDefFoundError: javax/faces/context/FacesContextFactory java.lang.IllegalStateException:无法在父级或祖先上下文中找到方法 - java.lang.IllegalStateException: Could not find method in a parent or ancestor Context java.lang.IllegalStateException:找不到@PathVariable - java.lang.IllegalStateException: Could not find @PathVariable java.lang.IllegalStateException:找不到方法? - java.lang.IllegalStateException: Could not find a method? java.lang.IllegalStateException:找不到方法 - java.lang.IllegalStateException: Could not find method java.lang.IllegalStateException:无法在父级或祖先语句中找到方法btnSubmit(View)for android:onClick - java.lang.IllegalStateException: Could not find method btnSubmit(View) in a parent or ancestor Context for android:onClick
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM