Glassfish上的Omnifaces EAR部署问题3.1.2.2 [英] Omnifaces EAR deployment issue on glassfish 3.1.2.2

查看:144
本文介绍了Glassfish上的Omnifaces EAR部署问题3.1.2.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Maven企业项目(骨感)
omnifaces 1.4.1
glassfish 3.1.2.2
primefaces 3.5
primefaces扩展0.6.3
myfaces extcdi 1.0.5



当我部署耳朵时,错误是:

 远程故障:部署期间发生错误:加载应用程序时发生异常:java.lang.IllegalStateException:ContainerBase.addChild:start:org.apache.catalina.LifecycleException:java.lang.IllegalArgumentException:javax.servlet.ServletException:com。 sun.enterprise.container.common.spi.util.InjectionException:为类创建托管对象时出错:class org.omnifaces.component.output.cache.CacheInitializerListener。有关更多详细信息,请参阅server.log。 

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



如果我参加包括所有ejb,罐子和战争在内的战争,它也会加载OK。

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



我可以根据需要提供堆栈跟踪。



EAR结构:

  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:错误创建一流的管理对象:在org.apache.catalina.core.StandardContext.start类org.omnifaces.component.output.cache.CacheInitializerListener
(StandardContext.java:5332 )
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
在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(Web容器。 Java的:2019)
在com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)在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)
在org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)
在的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.CommandRun nerImpl.access $ 1200(CommandRunnerImpl.java:95)
。在com.sun.enterprise.v3.admin.CommandRunnerImpl $ ExecutionContext.execute(CommandRunnerImpl.java:1291)
。在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.p (com.un.grizzly.http.DefaultProtocolFilter.execute)(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:在com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104 137)

。在com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
。在玉米.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)
在com.sun.grizzly.ContextTask.run(ContextTask.java:71)
在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)
导致:java.lang.IllegalArgumentException:javax.servle t.ServletException:com.sun.enterprise.container.common.spi.util.InjectionException:为类创建托管对象时出错:class org.omnifaces.component.output.cache.CacheInitializerListener


解决方案

ear / lib目录不是共享网络工件的理想场所。这取决于你在战争中究竟还有什么(例如,你的 WEB-INF beans.xml $ c>,任何Servlets? web.xml 文件中的确切内容等等),但在很多情况下,这种方式不能很好地工作。 p>

请参阅:



我不得不说,在创建两个战争的耳朵之后,我无法重现您的错误,并且完全相同的库和相同的版本在ear / lib(primefaces和myfaces-extcdi)中,但是类似于类加载器冲突的事情从来不容易重现。



您可能想尝试将所有web工件(OmniFaces,PrimeFaces等)两次战争的WEB-INF / lib。就我个人而言,我认为这是一个更好的做法,因为EJB模块不应该看到Web类型,并且放入ear / lib的内容对EJB模块中的类可见。



<目前,我认为这主要是一个EAR /类加载器问题,而不是OmniFaces的特定问题。如果您有一些证据表明OmniFaces确实在 https://github.com/omnifaces / omnifaces / issues 可能更适合进一步讨论。

I have a maven enterprise project (skinny) with omnifaces 1.4.1 glassfish 3.1.2.2 primefaces 3.5 primefaces extensions 0.6.3 myfaces extcdi 1.0.5

When i deploy the ear, the error is:

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.

If i deploy the omniface jar into glassfish lib directory, the application deployes OK.

It also loads OK if I i make a war including all ejb's, jars and wars.

Does anyone have a clue where to start debugging this issue?

I can provide stacktrace if needed.

EAR structure:

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

Best regards, hw

EDIT: some 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

解决方案

The ear/lib directory is not the ideal place to share web artifacts. It depends a bit on what else you exactly have in your wars (e.g. do you have a beans.xml in your WEB-INF, any Servlets? what's exactly in your web.xml files, etc), but in a lot of cases things just don't work nicely this way.

See for instance:

I have to say that I wasn't able to reproduce your error after creating an ear with two wars and the exact same libraries and same versions in the ear/lib (primefaces and myfaces-extcdi), but with things like classloader conflicts things are never easy to reproduce.

You might wanna try putting all web artifacts (OmniFaces, PrimeFaces, etc) in the WEB-INF/lib of both wars. Personally I think that's a better practice anyway as the EJB module is not supposed to see web types, and stuff you put in ear/lib is visible to classes in the EJB module.

For the moment I think this is primarily an EAR/classloader issue and not something specifically to OmniFaces. If you have some evidence that suggest OmniFaces does do something wrong opening an issue at https://github.com/omnifaces/omnifaces/issues might be a more appropriate place to discuss that further.

这篇关于Glassfish上的Omnifaces EAR部署问题3.1.2.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆