[jboss-user] [EJB 3.0] - Re: @EJB Annotation
mvlmachado
do-not-reply at jboss.com
Wed Apr 2 22:39:50 EDT 2008
hi guys,
I've tested as suggested by ashish and it worked. i guess this solution a 'hardwire', because you have to change the name property as you need to rename the EAR deployed. my last suggestion was using a user-defined name ("ejb/AloMundo"), instead of jboss standard name ("BeanName/Intf").
the code below doesn't work in jboss5.0.0.beta4 but it would be the simplest and standard way to referring an ejb. Surprisingly, the same code works in jboss4.2.2.GA.
| public class Alo {
|
| @EJB
| private AloRemote aloRemote;
|
| public String getAlo() {
| return aloRemote.alo();
| }
|
| }
|
adopting ashish's strategy, this code works in jboss5:
| public class Alo {
|
| @EJB(name="AloMundo/AloBean/remote")
| private AloRemote aloRemote;
|
| public String getAlo() {
| return aloRemote.alo();
| }
|
| }
|
AloMundo is earname, AloBean is ejbname
regards
marcus
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4141144#4141144
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4141144
More information about the jboss-user
mailing list