发生异常:java.lang.Throwable:javax.servlet.ServletException:Filter [struts2]:无法初始化

时间:2017-11-09 12:02:57

标签: java

我正在使用自由配置文件8.5。最近从旧struts迁移到struts 2.5.3。问题是当my_application在Bluemix云中启动/重启时,我看到下面的错误,如javax.servlet.ServletException:Filter [struts2]:无法初始化。请查看以下附件日志了解更多详情和协助。感谢

Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: [ERROR ] SRVE0315E: An exception occurred: java.lang.Throwable: javax.servlet.ServletException: Filter [struts2]: could not be initialized
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:157)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4982)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at [internal     classes]
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: Caused by: javax.servlet.ServletException: Filter [struts2]: could not be initialized
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: Caused by: java.lang.NoClassDefFoundError: javax.enterprise.inject.spi.BeanManager
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:71)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:75)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:79)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at java.util.concurrent.FutureTask.run(Unknown Source)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.<init>(ContainerImpl.java:344)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.ContainerImpl$5.create(ContainerImpl.java:299)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:79)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:155)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at java.util.concurrent.FutureTask.run(Unknown Source)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:516)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:514)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:129)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:52)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:560)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:466)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:499)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:63)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: ... 1 more
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:155)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.ContainerImpl.addInjectors(ContainerImpl.java:93)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:569)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.ContainerImpl$5.create(ContainerImpl.java:295)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:181)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:476)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:75)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:532)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:143)
Nov 08 13:32:58 my_application/[APP/PROC/WEB/0]: ... 1 more 

1 个答案:

答案 0 :(得分:0)

看起来依赖关系没有得到很好的解决,而它的部署在bluemix中。如果您正在使用maven项目,并且已解决了依赖关系,则可以将应用程序与服务器打包在一起,并使用cf命令行将其部署到bluemix。请参阅bluemix文档以获取命令。