JNDI lookups in AS7 vs JBoss 4.2.3
mikemil Jun 11, 2012 4:58 PMHi,
I am trying to research and size the changes that would be required for us to move from 4.2.3.GA up to AS7. In looking at the quick start examples and reading some of the docs
- https://docs.jboss.org/author/display/AS71/JNDI+Reference
- https://docs.jboss.org/author/display/AS71/Remote+EJB+invocations+via+JNDI+-+EJB+client+API+or+remote-naming+project
- https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+client+using+JNDI?focusedCommentId=31064082&#comment-31064082t
I am a bit confused. Previously, we set the <jndi-name> in the jboss.xml file to "ejb/<service-name>" for all of our EJB2.1 SLSBs. Now, after reading some of these articles, I am not quite sure how to proceed. In our application.xml, (for one of our servers) we have 20 ejb jars and 8 wars. The JNDI string was easy to determine, we just slapped "ejb/" on the front of the remote service name and that was it. With AS7, when I need to lookup a remote service interface on a remote client, do I have to know exactly which jar the service was deployed from in order to create the correct jndi name, or is there some other (easier) way to generate these strings programmatically at runtime? Is there another, better way?
Is this part of what the 'distinct name' supposed to do? If so, then why would that be part of this 'formula' for creating the jndi string?
formula: 'ejb:<appname>/<moduleName>/<distinctName>/<beanName>!<viewClassName>
Additionally, I understand the differences between the remote JNDI lookup and the new ejb client lookup. What I am trying to find is some documentation that explicitly shows these two approaches and exactly which values need to be in the jndi properities (either the file or added as properties to the InitialContext() constructor). I will create a small piece of documentation or sample code, if I can get it all down to
- Remote JNDI
- required properties
- EJB client lookup
- required properties