I use EJB inside OSGi bundles. And now when I need to get EJB I have long jndi, for example:
bean = (InterfaceName) ctx.lookup("java:global/longBundleName_version/OrganizationDirBean!and.plus.path.and.InterfaceName");
I want to change this part:
longBundleName_version
I mean, when I deploy bundle this part must be set from [glassfish-]application.xml or from [glassfish-]-ejb-jar.xml or from any other xml descriptor. I want jndi name for my ejb to be like:
java:global/newBundleNameWithoutVersion/etc
The problem that I can't find what I must set in these files. All variants I found in internet are not supported anymore and all I tried myself didn't work. Could you help me?
Please, don't offer mappedName as it can be used only(!) for remote beans. I do use beans which are at the same time both local and remote.
If someone is involved in glassfish development, could you at least point what bundles I must examine to find the question by myself? I will be very grateful.
You should annotate your
EJB
like that:After that,
GF
logs says:And at least I was able to inject like:
So I think manual look up should also work.