继续这个问题TomEE on eclipse, How to call a remote EJB from a JSF Managed bean?
当我尝试启动TomEE 1.6.0 plus服务器时出现以下错误。
我该怎么办?我在互联网上搜索过,发现这是因为Google Guava 15.0
虽然我理解他们在谈论什么,但我不知道如何将解决方案应用于TomEE。该链接解释了使用open web 1.2.1可以消除此错误。我可以看到TomEE已经使用了open web 1.2.1,所以
我如何摆脱这个错误?
INFO: Existing thread singleton service in SystemInstance(): org.apache.openejb.cdi.ThreadSingletonServiceImpl@43958fc2
Mar 02, 2014 11:01:24 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
INFO: OpenWebBeans Container is starting...
Mar 02, 2014 11:01:24 PM org.apache.webbeans.plugins.PluginLoader startUp
INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
Mar 02, 2014 11:01:24 PM org.apache.webbeans.plugins.PluginLoader startUp
INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
Mar 02, 2014 11:01:26 PM org.apache.openejb.cdi.OpenEJBLifecycle startApplication
SEVERE: CDI Beans module deployment failed
org.apache.webbeans.exception.inject.DeploymentException: javax.enterprise.inject.UnsatisfiedResolutionException: Api type [java.util.Set] is not found with the qualifiers
Qualifiers: [@javax.enterprise.inject.Default()]
for injection into Constructor Injection Point, constructor name : com.google.common.util.concurrent.ServiceManager, Bean Owner : [ServiceManager, Name:null, WebBeans Type:MANAGED, API Types: [java.lang.Object,com.google.common.util.concurrent.ServiceManager], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]
at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:213)
at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:187)
at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:162)
at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:43)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:799)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:612)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:503)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:409)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:148)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:296)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:246)
at org.apache.tomee.catalina.TomcatLoader.init(TomcatLoader.java:134)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:122)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
at org.apache.catalina.startup.Catalina.load(Catalina.java:640)
at org.apache.catalina.startup.Catalina.load(Catalina.java:665)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Api type [java.util.Set] is not found with the qualifiers
Qualifiers: [@javax.enterprise.inject.Default()]
for injection into Constructor Injection Point, constructor name : com.google.common.util.concurrent.ServiceManager, Bean Owner : [ServiceManager, Name:null, WebBeans Type:MANAGED, API Types: [java.lang.Object,com.google.common.util.concurrent.ServiceManager], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]
at org.apache.webbeans.util.InjectionExceptionUtil.throwUnsatisfiedResolutionException(InjectionExceptionUtil.java:60)
at org.apache.webbeans.container.InjectionResolver.checkInjectionPoint(InjectionResolver.java:195)
at org.apache.webbeans.container.BeanManagerImpl.validate(BeanManagerImpl.java:954)
at org.apache.webbeans.config.BeansDeployer.validate(BeansDeployer.java:470)
at org.apache.webbeans.config.BeansDeployer.validateInjectionPoints(BeansDeployer.java:420)
at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:200)
... 24 more
Mar 02, 2014 11:01:26 PM org.apache.openejb.assembler.classic.Assembler destroyApplication
INFO: Undeploying app: /Users/ajayamrite/Downloads/apache-tomee-plus-1.6.0/apps/DakiaCoreEAR
Mar 02, 2014 11:01:28 PM org.apache.openejb.assembler.classic.Assembler buildContainerSystem
SEVERE: Application could not be deployed: /Users/ajayamrite/Downloads/apache-tomee-plus-1.6.0/apps/DakiaCoreEAR
org.apache.openejb.OpenEJBException: Creating application failed: /Users/ajayamrite/Downloads/apache-tomee-plus-1.6.0/apps/DakiaCoreEAR: couldn't start owb context
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:897)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:612)
at org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:503)
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:409)
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:148)
at org.apache.openejb.OpenEJB.init(OpenEJB.java:296)
at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:246)
at org.apache.tomee.catalina.TomcatLoader.init(TomcatLoader.java:134)
at org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:122)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
at org.apache.catalina.startup.Catalina.load(Catalina.java:640)
at org.apache.catalina.startup.Catalina.load(Catalina.java:665)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: org.apache.openejb.OpenEJBRuntimeException: couldn't start owb context
at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:164)
at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:43)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:799)
... 20 more
Caused by: org.apache.openejb.OpenEJBRuntimeException: org.apache.webbeans.exception.inject.DeploymentException: javax.enterprise.inject.UnsatisfiedResolutionException: Api type [java.util.Set] is not found with the qualifiers
Qualifiers: [@javax.enterprise.inject.Default()]
for injection into Constructor Injection Point, constructor name : com.google.common.util.concurrent.ServiceManager, Bean Owner : [ServiceManager, Name:null, WebBeans Type:MANAGED, API Types:[java.lang.Object,com.google.common.util.concurrent.ServiceManager], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]
at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:190)
at org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:162)
... 22 more
Caused by: org.apache.webbeans.exception.inject.DeploymentException: javax.enterprise.inject.UnsatisfiedResolutionException: Api type [java.util.Set] is not found with the qualifiers
Qualifiers: [@javax.enterprise.inject.Default()]
for injection into Constructor Injection Point, constructor name : com.google.common.util.concurrent.ServiceManager, Bean Owner : [ServiceManager, Name:null, WebBeans Type:MANAGED, API Types:[java.lang.Object,com.google.common.util.concurrent.ServiceManager], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]
at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:213)
at org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:187)
... 23 more
Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Api type [java.util.Set] is not found with the qualifiers
Qualifiers: [@javax.enterprise.inject.Default()]
for injection into Constructor Injection Point, constructor name : com.google.common.util.concurrent.ServiceManager, Bean Owner : [ServiceManager, Name:null, WebBeans Type:MANAGED, API Types:[java.lang.Object,com.google.common.util.concurrent.ServiceManager], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]
at org.apache.webbeans.util.InjectionExceptionUtil.throwUnsatisfiedResolutionException(InjectionExceptionUtil.java:60)
at org.apache.webbeans.container.InjectionResolver.checkInjectionPoint(InjectionResolver.java:195)
at org.apache.webbeans.container.BeanManagerImpl.validate(BeanManagerImpl.java:954)
at org.apache.webbeans.config.BeansDeployer.validate(BeansDeployer.java:470)
at org.apache.webbeans.config.BeansDeployer.validateInjectionPoints(BeansDeployer.java:420)
at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:200)
... 24 more
Mar 02, 2014 11:01:28 PM org.apache.openejb.assembler.classic.Assembler createApplication
INFO: Assembling app: openejb
Mar 02, 2014 11:01:28 PM org.apache.openejb.util.OptionsLog info
INFO: Using 'openejb.jndiname.format={deploymentId}{interfaceType.openejbLegacyName}'
Mar 02, 2014 11:01:28 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=openejb/UserBusinessRemote) --> Ejb(deployment-id=openejb/User)
Mar 02, 2014 11:01:28 PM org.apache.openejb.assembler.classic.JndiBuilder bind
INFO: Jndi(name=global/openejb/openejb/User!org.apache.openejb.assembler.util.User) --> Ejb(deployment-id=openejb/User)
Mar 02, 2014 11:01:28 PM org.apache.openejb.assembler.classic.JndiBuilder bind
答案 0 :(得分:2)
https://code.google.com/p/guava-libraries/issues/detail?id=1668&thanks=1668&ts=1392364120讨论了这个问题。 添加像https://code.google.com/p/guava-libraries/issues/detail?id=1433#c9中描述的beans.xml对我有用。
这似乎是在番石榴16.0.1中修复的。
答案 1 :(得分:0)
在WEB-INF中定义一个exclusions.list,内容如下:
default-list
guava-
每一行都是从CDI角度忽略的前缀,default-list是默认值的快捷方式
答案 2 :(得分:0)
我无法弄清楚为什么会出现这种错误(我对它有一些模糊的想法,但不能完全用文字表达细节)但是我通过简单地用guava-15.0.jar文件取代它来摆脱它guava-16.0.1.jar文件。