我有一个 MDB,其方法注释为 @Postconstruct
。它正在正常执行。
今天我需要创建一个 ejb-jar.xml
文件来配置 <activation-config-property>
在构建时(因为我不知道如何在部署时配置 @ActivationConfigProperty
- 请参阅 this question )。
创建ejb-jar.xml
后容器不再调用@Postconstruct
方法。
什么是 ejb-jar.xml
相当于 @Postconstruct
?编辑:或者是否可以将注释与 XML 配置合并?
我正在使用 WebSphere 7。
最佳答案
我通过确保 <ejb-name>
解决了我的问题与 MDB 类名(无包)匹配。有了这个,@Postconstruct
方法找到了。请参阅this thread
关于java - @Postconstruct 的 ejb-jar.xml 等价物是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4869061/