-
1. Re: JAAS, pricipal=null issue
bondchan921 May 14, 2013 3:49 AM (in response to bondchan921)after more tests, I found
before "send message to queue" -identity can be propagated, user=janan and securityDomain=lrs
send message to queue -works, user=guest, and securityDomian=messaging
the next call from struts action - not work, user identity lost
Any clue ?
-
server2.log.zip 4.2 KB
-
-
2. Re: JAAS, pricipal=null issue
bondchan921 May 14, 2013 4:12 AM (in response to bondchan921)code we using to send message to queue
private <T extends Serializable> void publishObjectToQueueWithUserInternal(String queueName,T obj ){
QueueConnection connection = null;
QueueSession session = null;
Queue queue = null;
QueueSender queueSender = null;
try{
connection = queueFactory.createQueueConnection("guest", "guest");
session = connection.createQueueSession(true,Session.AUTO_ACKNOWLEDGE);
queue = (Queue)sls.getJNDIResource(queueName);
queueSender = session.createSender(queue);
ObjectMessage obj_message = session.createObjectMessage();
obj_message.setObject(obj);
queueSender.send(obj_message);
}catch(Na....
}
BTW, in the login-config.xml, I need to config 'other' with the same attribute as 'lrs' to avoid launch failed, which will using 'other' instead
-
login-config.xml 9.2 KB
-
-
3. Re: JAAS, pricipal=null issue
bondchan921 May 14, 2013 4:35 AM (in response to bondchan921)yeah, comfirmed, caused by step "send message to queue", when comment this step, works perfectly
Any one can help me out?
-
4. Re: JAAS, pricipal=null issue
bondchan921 May 15, 2013 4:21 AM (in response to bondchan921)the caller principal lost after invoke JMS layer..
SecurityAssociation.getCallerPrincipal() ---->get the right user
connection = queueFactory.createQueueConnection("guest","guest");
session = connection.createQueueSession(true,Session.AUTO_ACKNOWLEDGE);
queue = (Queue)sls.getJNDIResource(queueName);
queueSender = session.createSender(queue);
ObjectMessage obj_message = session.createObjectMessage();
obj_message.setObject(obj);
queueSender.send(obj_message);
SecurityAssociation.getCallerPrincipal() ----->principal= null
-
5. Re: JAAS, pricipal=null issue
bondchan921 May 19, 2013 11:23 PM (in response to bondchan921)sending JMS in a new thread works for my case