In my project I have an MBean that has to use local singleton EJB. Unfortunately I cannot resolve EJB in MBean class.
Two approached I tried actually failed and I would like to know why.
First I tried with @EJB annotation on field of my MBean. I put everything in EAR file and it seems (according to logs) that my ejbs are being deployed before my mbean but anyway the ejb field is empty. Anyone could give me a hint why?:)
Than i tried with resolving @EJB with InitialContext. I noticed that my EJBs had been registered with name:
ear_name/ejb_jar_name/ejbname!ejb_interface_class. What should I do to register them with other jndi name?
I tried to set name and mappedName property of @Singleton annotation which I use but without success.