Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SecurityException in onMessage() callback

0 views
Skip to first unread message

Bill O'Keefe

unread,
Oct 28, 2002, 11:38:58 PM10/28/02
to

I am running into a problem when processing a message in my
MessageListener. Briefly, when I send a message asynchronously,
I register a MessageListener to wait for the response so we can
continue processing without waiting. Following a fresh start
of my client-side WebLogic instance, the first time a response
is delivered to one of these MessageListeners, I get a
SecurityException when I try to perform some JMS operation
operation in the onMessage() callback. I have tried several
methods, and each reports the same error:

DEBUG [2002-10-25 15:32:02,743](MessageFramework.java:1429) - onMessage entered
DEBUG [2002-10-25 15:32:02,753](MessageFramework.java:1434) - Max retries = 0

...
DEBUG [2002-10-25 15:33:04,843](MessageFramework.java:1444) - Returned from MessageResponseHandler:
wait=0
ERROR [2002-10-25 15:33:04,883](MessageFramework.java:1493) - onMessage: Unexpected
JMS Exception -
weblogic.jms.common.JMSException: System error: java.lang.SecurityException:
Authentication for user
system denied in realm wl_realm

Start server side stack trace:
java.lang.SecurityException: Authentication for user system denied in realm wl_realm
at weblogic.security.acl.Realm.authenticate(Realm.java:212)
at weblogic.security.acl.Realm.getAuthenticatedName(Realm.java:233)
at weblogic.security.acl.internal.Security.authenticate(Security.java:135)
at weblogic.security.acl.internal.Security.verify(Security.java:90)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:242)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
End server side stack trace

In this above case, the error happened on the acknowledge() call. However, it
also does the same thing if I call setMessageListener(null) first, or even just
mQueueReceiver.close().

What I find even more puzzling is that if I send/receive the
same message sequence again and again (without restarting my
WebLogic instance), this does not occur, i.e., I am able to
execute the entire onMessage() handler with no problem. It only
happens the first time. BTW, I do no restart the remote server
side WebLogic (where the JMS Server I'm connecting to resides)
at all.

I have enclosed my handler in hopes that someone will see
something wrong with it. The QueueConnection was created with
no arguments, hence I believe it should be using the default
user identity (guest, right?). But, I've also tried specifying
various username/password combinations (including my system
credentials), but this has no apparent effect. Any ideas as to
what I'm doing wrong? I can supply more of the client-side JMS
setup/processing as needed.

public void onMessage(Message m)
{
try
{
Logger.integration.debug("onMessage entered: " + m.getJMSCorrelationID());
// Initialize the retry counter the first time in
if (mRetryCount == -1)
{
mRetryCount = mHandler.getMaxRetries();
Logger.integration.debug("Max retries = " + mRetryCount);
}

long wait = 0;
if (m instanceof ObjectMessage)
{
// Extract the XML body from the response, and invoke
// the application-supplied callback to process it.
InputStream xmlResponse = extractXmlBody(m);
wait = mHandler.processResponse(xmlResponse);
Logger.integration.debug
("Returned from MessageResponseHandler: wait=" + wait);
}
else
{
// Handle error
Logger.integration.error
("onMesage: Unexpected JMS message type: " + m);
}

// If the handler successfully processed the response, or
// we exhausted our retry attempts, ACK the message and
// close up shop...
if (wait <= 0 || mRetryCount == 0)
{
// Deactivate the listener then shutdown the receiver
mQueueReceiver.setMessageListener(null);
mQueueReceiver.close();
Logger.integration.debug
("About to remove Listener " + this);

synchronized (mActiveListeners)
{
mActiveListeners.remove(this);
}

// ACK the message
try
{
Logger.integration.debug("About to ACK the message");
m.acknowledge();
Logger.integration.debug("1st ACK succeeded");
}
catch (JMSException jme)
{
Logger.integration.error("JMSException while trying to
explicitly ACK the message. Will try again.");
Logger.integration.debug("About to ACK the message AGAIN");
m.acknowledge();
Logger.integration.debug("2nd ACK succeeded");
}

mQueueSession.close();
}
// Otherwise, if additional retries allowed, delay as
// requested by the handler, then re-register the JMS
// MessageListener to handle the re-delivery of the message.
else if (--mRetryCount >= 0)
{
Logger.integration.debug("About to wait for " + wait);
Thread.sleep(wait);
//reregister();
Logger.integration.debug("... awake now. return w/o ack");
}
}
catch (InterruptedException ie)
{
}
catch (MessageFrameworkException mfe)
{
Logger.integration.error
("onMessage: Unexpected failure - " + mfe);
}
catch (JMSException jmse)
{
Logger.integration.error
("onMessage: Unexpected JMS Exception - " + jmse);
}
}

John S

unread,
Nov 4, 2002, 5:40:50 PM11/4/02
to

What WLS version and SP are you on? OS platform version?

John S

unread,
Nov 6, 2002, 3:43:29 PM11/6/02
to
0 new messages