Try to avoid putting any CDI archives in EAR/lib and you should be safe and sound. That is, in your first 'graph', move the ear/lib/jar into ear/ejb as a dependency and it should work.
The reason why you are getting these troubles is that CDI will see ear/ejb, ear/war and ear/lib all as a separate bean archives and therefore will not be able to resolve the beans you need.
Let me know if that helps.
|