如何将来自不同项目模块的@Inject对象包含为jar

时间:2013-11-21 14:38:26

标签: java-ee vaadin cdi vaadin7

我在多模块maven项目中使用Vaadin-CDI,其中包含一个常用类所需的模块,如接口,抽象类等。我的问题是,我无法像往常一样 @Inject 类anotated @UIScoped ,它被置于核心模块中。我仍然得到 UnsatisfiedResolutionException

SEVERE: CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type [com.web.core.TestClass] is not found with the qualifiers 
Qualifiers: [@javax.enterprise.inject.Default()]
for injection into Field Injection Point, field name :  cls, Bean Owner : [DispUI, Name:null, WebBeans Type:MANAGED, API
 Types:[com.vaadin.ui.AbstractComponent,java.util.EventListener,com.vaadin.event.MethodEventSource,com.vaadin.server.Abs
tractClientConnector,com.vaadin.server.VariableOwner,java.lang.Iterable,com.vaadin.ui.HasComponents$ComponentAttachDetac
hNotifier,java.lang.Object,java.io.Serializable,com.vaadin.ui.LegacyComponent,com.vaadin.event.ConnectorEventListener,co
m.vaadin.event.Action$Notifier,com.vaadin.ui.Component,com.vaadin.event.Action$Container,com.vaadin.ui.SingleComponentCo
ntainer,com.vaadin.ui.HasComponents,com.vaadin.server.Sizeable,com.vaadin.ui.Component$Focusable,com.vaadin.server.Clien
tConnector,com.vaadin.ui.AbstractSingleComponentContainer,com.vaadin.shared.Connector,com.web.disp.DispUI,com.vaa
din.ui.UI], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]

我在IBM WebSphere Info中找到了一些名为 2的建议。解决不可满足的依赖性。(可在此处找到http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.multiplatform.doc%2Finfo%2Fae%2Fae%2Ftweb_troubleshoot_cdi.html)。根据这个,我检查了我的项目的部署程序集属性,并正确添加了core.jar。

我应该检查下一步该怎么办?非常感谢您的回答!

1 个答案:

答案 0 :(得分:16)

你的公共jar需要一个META-INF/beans.xml。你检查过了吗?