Vaadin CDI problem JavaEE

I cant @Inject some resource to VaadinUI class.

I have vaadin-cdi 2.0.0. in my pom.xml and empty beans.xml in WEB-INF.


WELD-001408: Unsatisfied dependencies for type TestRest with qualifiers @Default
at injection point [BackedAnnotatedField]
@Inject private org.acidcrud.lp.vaadin.TestUi.test
at org.acidcrud.lp.vaadin.TestUi.test(
WELD-001474: Class is on the classpath, but was ignored because a class it references was not found: org.acidcrud.lp.service.TestService from [Module “deployment.lp-ear-0.0.1-SNAPSHOT.ear.lp-web-0.0.1-SNAPSHOT.war” from Service Module Loader]

Check this another thread on the topic:!/thread/16052360/16094026

You have likely by hit some limitations of EAR deployment configurations. I guess that you are trying to inject a class that is in another WAR than where Vaadin CDI add-on is or vica versa. That is not liked by classloader.

This solution did not work for me. I add listener to web.xml and nothing happed. Same mistake. Source code availible by link because I cant attach it here. Could you plz help me?

Do you have Tests and Vaadin CDI add-on in same or separate WAR?

Injected bean and Vaadin CDI add-on are in the same WAR. I have just one WAR.

I really do not know how your project is structured, so I cannot say for sure. But in certain scenarios if your Tests project is separated module from the main application, you may need another beans.xml there.

The link to the project is broken.


You could try to remove the provided scope on the ejb-artefact in the war-pom. I don’t think cdi injection work across deployment units out of the box. I had a similar problem once, see the following stackoverflow question: I do not recall how it really went, but when I look at the source now it seems I ended up with plain war-files with the ejb-jars included, so I probably ran into some other problem with the solution I described. It might have had to do with using one-jar plugin or some such to create fat jars for the ejb. One could possibly deploy the ejbs in ear-files instead, to avoid using fat jars. Or maybe the plugins for that have gotten better the last yeras. may be of some help.

I have no idea what happent but its in work now! I didnt do nothing for a couple of days and now problem solved. Its some kind of New Year miracle. Thank everyone for help!
I removed the provided scope on the ejb-artefact in the war-pom and
org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory - new mistake.
Add provided scope again and all of problems solved.
I really have no idea whats going on.