Using CDI in a websphere shared library

2019-05-20 13:09发布

We use a shared library defined in the websphere admin console to share classes between several applications. I was wondering if it is possible to use CDI (Context and Dependecy Injection) in these classes? If so do I just need to put the beans.xml in the jar that is in the shared library, or are there further steps?

Note: I can't move away from using a shared library, as this would be too much refactoring work.

1条回答
啃猪蹄的小仙女
2楼-- · 2019-05-20 13:22

No, classes included in a shared library are not considered as CDI beans. Only archives included in the application itself can be considered for CDI.

查看更多
登录 后发表回答