The JNDI Names are on a server level. You MUST have different names for the ejbs if u are deploying them to the same server.
Yeah I realise that, what I was wondering was if applying version numbers to JNDI names was common/good practice.
So the JNDI name for an EJB...
It is not a very common thing to do - at least not with complex applications with many components. Apart from having to change descriptors and references in other components calling your service, it becomes a bit of a maintenance nightmare working out what broke, what version you were calling and the rest.
However, there are cases where it might be useful but I'm having trouble picturing it. ;)
Actually what we do here in my project is let Ant take care of that mess.
We have an XML template which has a reference tag(for e.g. @type@) embedded in the XML
When we build it, we copy it to another XML and use the ant replace to replace all @type@ to say "ver1" . so all my jndi names become
and whenver we go to another deployment for another app, just change ver1 to ver2 and ant takes care of building it.
I use different subcontexts myself, rather than change the name the object is bound under -- but I guess the difference is minimal.