1
我在glassfish v4上運行,並使用messagedriven bean。目前,我定義豆運行在其主要的glassfish-ejb-jar.xml
,如:如何使用註釋設置MessageDriven bean的主體?
<enterprise-beans>
<ejb>
<ejb-name>MessageConsumerBean</ejb-name>
<principal>
<name>MDBPrincipal</name>
</principal>
是否有可能用做同樣剛剛例如註解@MessageDriven
?
您是否試過@RunAs註釋?它不會設置調用者主體,但會允許您運行受保護的方法。 – nomoa 2014-10-21 13:12:23
@nomoa是的。但正如你所說,它不會設置委託人。 – Roland 2014-10-21 13:59:51
好吧,我沒有其他線索,除了挖掘GF源代碼的一個晦澀的@ActivationConfigProperty。這是MDB的一個已知限制(請參閱http://bitpop.online.fr/j/java/expert-one-on-one-j2ee-design-and- development/lib0066.html中的編程限制應用於MDB) – nomoa 2014-10-21 15:32:09