-
1. Re: How to view all of the JNDI name in jboss7?
welle Aug 9, 2013 3:29 AM (in response to andy215)I'm not sure I understand what you want. The JNDI viewer in the management console shows you all that is bound in the JNDI (from what I know though).
Why would you use JNDI to lookup a MBean and not the MBean server?
-
2. Re: How to view all of the JNDI name in jboss7?
andy215 Aug 9, 2013 3:46 AM (in response to welle)In the JBoss5, if we register a mbean to mbean server, this mbean will be binded with a JNDI name automaticlly. By the preview JBoss versions, we also can lookup MBeanServer by a JNDI name. Add we can lookup all of the mbeans(registered to boss mbean server by ourself) by JNDI name. But for JBoss7, I can't lookup these MBeans.
-
3. Re: How to view all of the JNDI name in jboss7?
welle Aug 9, 2013 3:52 AM (in response to andy215)Aha! The correct way is to use the JMX standard of looking up MBeans (and the getting access to the MBeanServer) and NOT going through JNDI. I guess your client is local (in the JBoss VM) and not remote, or?
-
4. Re: How to view all of the JNDI name in jboss7?
arnoldjohansson Aug 9, 2013 4:13 AM (in response to andy215)1 of 1 people found this helpfulFor AS7 you perform remote access to a JMX MBean with the new jmx-remoting protocol. See code sample here.
Note that you might need to enable the server to accept incoming calls. See comment in code sample for this.
-
5. Re: How to view all of the JNDI name in jboss7?
andy215 Aug 9, 2013 5:22 AM (in response to welle)Because by JNDI I can lookup a remote object as a local stub, then I can invoke remote object's method like it's in the local JVM. I don't whether JBoss7 don't register every mbean to JNDI server automaticlly. By for JBoss5, I can do this. And I don't think JBoss7 remove this good feature.
-
6. Re: How to view all of the JNDI name in jboss7?
andy215 Aug 9, 2013 5:30 AM (in response to arnoldjohansson)So we only can access the remote mbean by the MBeanconnection, if so, that's really bad. Because in JBoss5, I can get a remote mbean by JNDI lookup, then I can invoke the remote mbean's method like what happens in local JVM. I can't believe JBoss7 removed this feature.
JNDI code(vey simple)
// define remote ip, port and authtication parameters in this hashtable.
Hashtable hashtable;
InitialContext ctx = new InitialContext(hashtable);
User user = (User) ctx.lookup("java:/user");
System.out.println(user.getName());
-
7. Re: How to view all of the JNDI name in jboss7?
arnoldjohansson Aug 9, 2013 5:55 AM (in response to andy215)Well, if you want/need to make that kind och calls you could make make the MBean a SLSB.