JMX - Error while trying to query mbean
I am getting an error while trying to query MBeans:
<Mar 27, 2007 4:27:32 AM MDT> <Warning> <JNDI> <BEA-050001> <WLContext.close() was called in a different thread than the one in which it was created.>
ERROR: Tue Mar 27 04:27:32 MDT 2007MBeanHome being refreshed weblogic.management.NoAccessRuntimeException: User guest does not have access permission on weblogic.admin.mbean.MBeanHome
Bea doc says that the cause of this error is that the context is closed in a different thread than the one that created it. I have multiple thread that query the mbeans. The code that does the above is in a synchronized block. The code runs fine on some environments. On wls 8.1 it is giving the above error.
Anyone faced this issue? Any ideas, suggestions?
thanks a lot
Jain
[835 byte] By [
saurabh81a] at [2007-11-26 23:28:26]

# 1
Hi,
I have not worked with WLS.
It looks however as if you were missing a permission to access
weblogic.admin.mbean.MBeanHome.
It could be that WLS 8.1 requires that you set up additional permissions
for your code to execute. I would suggest that you try to figure out
how and where these permission can be configured.
Scanning WLS doc for 'access permission' or 'access control' might
be a starting point.
Hope this helps,
-- daniel
JMX, SNMP, Java, etc...
http://blogs.sun.com/jmxetc
# 2
Hi Daniel
Thanks for your help. Here is some more info.
I have another application that goes out and tries to get the MBeanHome. Here is the code:
Environment env = new Environment();
env.setProviderUrl(t3URL);
env.setSecurityPrincipal(t3UserName);
env.setSecurityCredentials(t3Password);
ctx = env.getInitialContext();
mBeanHome = (MBeanHome) ctx.lookup MBeanHome.ADMIN_JNDI_NAME);
This code runs fine in the app. where it is not threaded. But the same code when run in a separate thread is throwing the error. It is happening only in wbl 8.1. In wls 6.1 it runs fine. It is strange. Any clues will be appreciated.