I poked around in the source code some time ago.
From memory, an internal reference is created for each session bean defined in ejb-jar.xml. The jndi-name attribute is set as default to the ejb-name, and then overwritten if a reference is found in jboss.xml.
So each reference in jboss.xml will overwrite any previous reference - the behaviour that you describe.
You should (I haven't tried this) be able to get round this by defining multiple EJB's that use the same class - as shown below :-
blah blah blah
It shouldn't take you long to find out if this works.
Thanks James, thats a similar idea to what we came up with, but it makes our xdoclet generation a little more complex (if its even possible), as well as making the deployment more coupled with development.
Do you know if its supposed to work as we are expecting, or its correctly only giving us a single instance when we define multiple bean/jndi mappings in JBoss.xml ? (The docs sorta suggest that its possible).
I tweaked my deployment files to try this out. See the attached ejb-jar.xml and jboss.xml.
To summarise the results of testing :-
1. Creating another EJB milton/errors/logger2 with the same set of classes results in two parallel deployments of the same bean under different names. See definition in ejb-jar.xml.
2. Looking in jboss.xml, the first session bean definition reassigns the jndi name of logger2 to redirectlogger.
3. The second session bean definition overwrites the reassignment in the first definition. So you only have one JNDI name for the logger2 bean - redirectloggeragain.