0
JBoss AS7/EAP6存在問題。在MDB中,當我查找SSB並調用其方法時,該調用始終是匿名的,即sessionContext.getCallerPrincipal()
返回Principal(匿名)。總是......在AS5中一切都很好。從MDB調用SSB在JBoss AS7/EAP6中始終是匿名的
我該如何解決這個問題才能與通過身份驗證的用戶進行通話?
我MDB:
@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/piQueue"),
@ActivationConfigProperty(propertyName = "dLQMaxResent", propertyValue = "3")
})
@SecurityDomain("mySecurityDomain")
public class PIMessageBean implements MessageListener {
...
**//subject always anonymous...**
Subject subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container");
PIManager pim = lookupPIManager();
pim.getPIs(); **//call is anonymous**
...
}
我的隊列設置:
<subsystem xmlns="urn:jboss:domain:messaging:1.2">
<hornetq-server>
...
<jms-destinations>
<jms-queue name="piQueue">
<entry name="queue/piQueue"/>
<entry name="java:jboss/exported/jms/queue/piQueue"/>
</jms-queue>
</jms-destinations>
<security-domain>mySecurityDomain</security-domain>
</hornetq-server>
</subsystem>
我的安全域:
<security-domain name="mySecurityDomain" cache-type="default">
<authentication>
<login-module code="com.qu.vad.CustomUsernamePasswordLoginModule" flag="required">
</login-module>
</authentication>
</security-domain>