-
1. Re: Understand JNDI naming convention
peterj Aug 13, 2009 1:54 PM (in response to mohitanchlia)1) For each web app deployed to the app server there is a "java:comp" namespace whose content is accessible only by that app. The app server prefills some names but you have to do some work (such as add resource-ref entries to your web.xml) to get others.
mapped-name for what? In an @Stateless annotation? In an @EJB annotation? mapped-name is usually the full JNDI name (usefull for referencing the global namespace) while name is within the "java:" namespace for the app.
2) Names in the global namespace are accessible from remote clients (that is, running in a separate JVM) - remote clients cannot access names in "java:*". For example, if a remote client needs access to an EJB, it must look up the name in the global namespace.
3) You never said exactly where you are seeing this entry (I don't see it), but if it is part of the description for a"java:comp" then it is the name of the MBean name created for the application. MBean names have the pattern:<namespace>:<key-value-pair>[,<key-value-pair>]*
so in your case "e.cache" is the namespace, and there is only one key-value pair "service=CacheLoader" -
2. Re: Understand JNDI naming convention
mohitanchlia Aug 13, 2009 3:24 PM (in response to mohitanchlia)Thanks! What's the difference between java:comp and java:com/env?
Also, regarding my second question who uses the namespace? For eg: In jmx console under jboss.j2ee I see:jar=efe-messaging.jar,name=RouterBean,service=EJB3 I am not sure why it's defined this way? And also is name= really JNDI name? Pardon me if I am asking abvious questions.
-
3. Re: Understand JNDI naming convention
mohitanchlia Aug 13, 2009 3:25 PM (in response to mohitanchlia)My previous post is not formatter correctly
Thanks! What's the difference between java:comp and java:com/env?
Also, regarding my second question who uses the namespace? For eg: In jmx console under jboss.j2ee I see:jar=ee-messaging.jar,name=RouterBean,service=EJB3
I am not sure why it's defined this way? And also is name= really JNDI name?
Pardon me if I am asking abvious questions. -
4. Re: Understand JNDI naming convention
peterj Aug 13, 2009 4:41 PM (in response to mohitanchlia)java:comp/env is the enterprise naming context (ENC) and contains entries from the resource-ref section of your web.xml file.
regarding my second question who uses the namespace?
I hope you mean your third question. The namespace (within an MBean name) has no special meaning - it is simply used as a convenience to prevent naming conflicts among MBeans.I am not sure why it's defined this way?
JBoss AS uses a specific pattern for MBean names that it generates, though it uses different patterns for different items. For example, servlets use one MBean name pattern while EJBs use another. What you showed was part of an MBean name for an EJB (there is more to it on the prior line in the jmx-console output)And also is name= really JNDI name?
Not necessarily. It all depends on how the MBean is defined and named. -
5. Re: Understand JNDI naming convention
mohitanchlia Aug 13, 2009 6:05 PM (in response to mohitanchlia)ok ..starting to make little sense:
jar=ee-messaging.jar,name=RouterBean,service=EJB3
So if I see something like this (above) it really means this is a Mbean managing "RouterBean" in this example? So for every Bean there is a Mbean that is created to manage the resource? Am I saying it right? -
6. Re: Understand JNDI naming convention
peterj Aug 13, 2009 7:04 PM (in response to mohitanchlia)Yes, that is correct. And if you go into the jmx-console you can see that MBean, and if you examine the MBean you might see some interesting data regarding your EJB (such as response times).