Omnifaces EAR在glassfish 3.1.2.2上的部署问题



我有一个maven企业项目(skinny)omnifaces 1.4.1glassfish 3.1.2.2primefaces 3.5Primefaces扩展0.6.3Myfaces extcdi 1.0.5

当我展开耳朵时,错误是:

remote failure: Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.omnifaces.component.output.cache.CacheInitializerListener. Please see server.log for more details.

如果我将omniface jar部署到glassfish lib目录中,则应用程序部署成功。

如果我创建一个war,包括所有ejb, jar和war,它也可以加载。

有没有人知道从哪里开始调试这个问题?

如果需要,我可以提供堆栈跟踪。

耳朵结构:

PROJECT-EAR
  |
  -META-INF
  |
  -lib
      |
      - omnifaces-1.4.1.jar
      - myfaces-extcdi-bundle-jsf20-1.0.5.jar
      - primefaces-3.5.jar
      - PROJECT-lib.jar
  |
  - PROJECT-WEB1.war
  - PROJECT-EJB.jar
  - PROJECT-WEB2.war

敬上,hw

编辑:一些stackinfo:

SEVERE: ContainerBase.addChild: start: 
    org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException:    javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.omnifaces.component.output.cache.CacheInitializerListener
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5332)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
    Caused by: java.lang.IllegalArgumentException: javax.servlet.ServletException: com.sun.enterprise.container.common.spi.util.InjectionException: Error creating managed object for class: class org.omnifaces.component.output.cache.CacheInitializerListener

ear/lib目录不是共享web工件的理想场所。这取决于你在你的战争中究竟有什么(例如,你在你的WEB-INF中有一个beans.xml,任何servlet ?什么是在你的web.xml文件,等),但在很多情况下,事情只是不能很好地工作这种方式。

参见:

  • http://forum.primefaces.org/viewtopic.php?f=3& t = 2332
  • https://community.jboss.org/message/799262

我不得不说,在使用两个war和ear/lib中完全相同的库和相同的版本(primefaces和myfaces-extcdi)创建ear后,我无法重现您的错误,但是像类加载器冲突这样的事情从来都不容易重现。

你可能想尝试把所有的web工件(OmniFaces, PrimeFaces等)在web - inf/lib的两个战争。我个人认为这是一个更好的做法,因为EJB模块不应该看到web类型,你放在ear/lib中的东西对EJB模块中的类是可见的。

目前我认为这主要是一个EAR/类加载器问题,而不是专门针对OmniFaces的问题。如果你有一些证据表明OmniFaces确实做错了什么,在https://github.com/omnifaces/omnifaces/issues上打开一个问题可能是一个更合适的地方来进一步讨论。

相关内容

  • 没有找到相关文章

最新更新