7

I am using Vaadin-CDI in multi-module maven project with one module desired for common classes such interfaces, abstract classes and others. My problem is, that I am not able to @Inject class anotated @UIScoped as usual, which is placed in core module into another. I am still getting 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]]

I have found some advice in IBM WebSphere Info called 2. Resolve an unsatisfiable dependency. (can be found here http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.multiplatform.doc%2Finfo%2Fae%2Fae%2Ftweb_troubleshoot_cdi.html). According to this, I checked my project's Deployment Assembly properties and core.jar is added correctly.

What next should I check ? Many thanks for answers !

s0vet
  • 375
  • 4
  • 8
  • 22

1 Answers1

17

Your commons jar needs a META-INF/beans.xml. Did you check that?

Jin Kwon
  • 20,295
  • 14
  • 115
  • 184
Jan Galinski
  • 11,768
  • 8
  • 54
  • 77
  • Hi Jan, thanks for an idea ! First of all, I've changed common jar project facet from UtilityModule to EJBModule. That change caused creation of META-INF folder, where I've put an empty beans.xml file. Now it is working ! – s0vet Nov 22 '13 at 09:15
  • 1
    Glad to hear, thanks for accepting. Good luck with your project. – Jan Galinski Nov 23 '13 at 09:37
  • I had it under WEB-INF and moved to META-INF and it worked. thanks! – Luís Soares Apr 07 '15 at 12:09