CDI with ejb 3.1 , weld-logger on glassfish v3.0.1

前端 未结 2 652
猫巷女王i
猫巷女王i 2020-12-11 13:48

Scenario: 1) create maven ear project, create war project inside 2) add beans.xml to war project`s WEB-INF/ 3) creat simple @Steateless bean

project - http://drp.ly

相关标签:
2条回答
  • 2020-12-11 14:03

    looks like we cant use Injection of weld logger in ejb in a case of glassfish ejb container because of it is ejb container managed bean and it dont see producer

    Current design is to separate ejb and war module - at list it forks for me.

    0 讨论(0)
  • 2020-12-11 14:25

    Either package your EJB in a .war OR package it as ejb-jar inside a "traditional" .ear. I consider the .war packaging as a convenience for projects without strong modularization needs. But this doesn't mean the rules changed when using an .ear packaging.

    In other words, I don't think you can mix both approaches and wouldn't expect a container to support it.

    As a side note, I wonder why you're packaging cdi-api inside the EAR, I think the API is provided by the container.

    In my opinion, you should try to keep things simple.

    0 讨论(0)
提交回复
热议问题