首页 > 解决方案 > Websphere:java.lang.IllegalStateException:没有为此应用程序配置工厂

问题描述

我将我的应用程序 tomcat 7 迁移到 web sphere 9 版本。服务器成功启动,但是当我尝试加载页面时,出现以下错误。

java.lang.IllegalStateException:没有为此应用程序配置工厂。如果 faces-initialization 根本不起作用,就会发生这种情况 - 确保正确包含基本 Faces 应用程序所需的所有配置设置,并且包含所有必要的库。还要检查您的 Web 应用程序和容器的日志记录输出是否有任何异常!如果您这样做但什么也没找到,则错误可能是由于您使用了一些不支持通过 TLD 文件注册上下文侦听器的特殊 Web 容器,并且您的 web.xml 中未设置上下文侦听器。

典型的配置如下所示;

org.apache.myfaces.webapp.StartupServletContextListener

at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:286)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:206)
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:342)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:168)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.load(ServletWrapper.java:1385)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1029)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:82)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:963)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:382)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:532)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:318)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:289)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1909)

我应该怎么做才能解决它?谢谢..

标签: jsfwebsphere-9

解决方案


我在上面的 servlet 侦听器配置中有同样的错误。但在我的情况下,我将文件夹 Websphere 更改为默认安装 (C:\swdtools\IBM\Websphere)。文件夹 Websphere 必须位于文件夹 C:\swdtools\IBM 内。然后我的错误解决了。


推荐阅读