Discussion:
[jboss-user] [Datasource Configuration] - How to view all of the JNDI name in jboss7?
andy215
2013-08-09 04:09:00 UTC
Permalink
andy215 [https://community.jboss.org/people/andy215] created the discussion

"How to view all of the JNDI name in jboss7?"

To view the discussion, visit: https://community.jboss.org/message/832046#832046

--------------------------------------------------------------
In JBOSS5, we can access the jmx-console by ip:port/jmx-console, and we can see the all of the JNDI name by JNDIView.
But in JBOSS7, I just can see several JNDI name on the container/naming page. I want to lookup a MBean by new InitalContext().lookup("jndiName"),  jboss report naming not found. So how can I get all of the JNDI naming on JBOSS JNDI server?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/832046#832046]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
Anders Welen
2013-08-09 07:29:32 UTC
Permalink
Anders Welen [https://community.jboss.org/people/Welle] created the discussion

"Re: How to view all of the JNDI name in jboss7?"

To view the discussion, visit: https://community.jboss.org/message/832072#832072

--------------------------------------------------------------
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?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/832072#832072]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
andy215
2013-08-09 07:46:34 UTC
Permalink
andy215 [https://community.jboss.org/people/andy215] created the discussion

"Re: How to view all of the JNDI name in jboss7?"

To view the discussion, visit: https://community.jboss.org/message/832075#832075

--------------------------------------------------------------
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.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/832075#832075]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
Anders Welen
2013-08-09 07:50:45 UTC
Permalink
Anders Welen [https://community.jboss.org/people/Welle] created the discussion

"Re: How to view all of the JNDI name in jboss7?"

To view the discussion, visit: https://community.jboss.org/message/832076#832076

--------------------------------------------------------------
Aha!  The correct way is to use the JMX standard of lookuing 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?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/832076#832076]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
Arnold Johansson
2013-08-09 07:58:45 UTC
Permalink
Arnold Johansson [https://community.jboss.org/people/arnoldjohansson] created the discussion

"Re: How to view all of the JNDI name in jboss7?"

To view the discussion, visit: https://community.jboss.org/message/832078#832078

--------------------------------------------------------------
In AS7 you access a JMX MBean with the new jmx-remoting protocol. See code sample https://github.com/swesource/sample-jee/blob/master/sample-jee-standalone-jmx-client/src/main/java/com/swesource/sample/jee/jmx/JmxClient.java here.
Note that you might need to enable the server to accept incoming calls. See comment in code sample for this.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/832078#832078]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
andy215
2013-08-09 09:22:33 UTC
Permalink
andy215 [https://community.jboss.org/people/andy215] created the discussion

"Re: How to view all of the JNDI name in jboss7?"

To view the discussion, visit: https://community.jboss.org/message/832089#832089

--------------------------------------------------------------
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.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/832089#832089]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
andy215
2013-08-09 09:30:05 UTC
Permalink
andy215 [https://community.jboss.org/people/andy215] created the discussion

"Re: How to view all of the JNDI name in jboss7?"

To view the discussion, visit: https://community.jboss.org/message/832090#832090

--------------------------------------------------------------
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());
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/832090#832090]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
Arnold Johansson
2013-08-09 09:55:26 UTC
Permalink
Arnold Johansson [https://community.jboss.org/people/arnoldjohansson] created the discussion

"Re: How to view all of the JNDI name in jboss7?"

To view the discussion, visit: https://community.jboss.org/message/832091#832091

--------------------------------------------------------------
Well, if you want/need to make that kind och calls you could make make the MBean a SLSB.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/832091#832091]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
Loading...