I have vaadin-cdi 2.0.0. in my pom.xml and empty beans.xml in WEB-INF.
Error:
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(TestUi.java:0)
WELD-001474: Class org.acidcrud.lp.rest.TestRest 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]
.
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?
https://nofile.io/f/HT4tBundmNa/lp.zip
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.
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: https://stackoverflow.com/questions/32984603/how-to-call-separately-deployed-ejb3-on-wildlfy 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.
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!
UPD
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.