ejb@glassfish.java.net

Problem with injecting EJB 2 in EJB3

From: Dieter De Meyer <dieterdemeyer_at_gmail.com>
Date: Mon, 6 Jul 2009 15:48:38 +0200

Hello,



At our project, we are trying to access an EJB 2 Session Bean from within an
EJB3 Session Bean with the @EJB injection.

Following the EJB FAQ on Java.Net, we configured our EJB3 as followed:



@Stateless

public class Foo implements fooService {

                @EJB(name = “ejb/local/BarBean”, beanInterface =
BarLocal.class)

                private BarLocal bar;

}



The generated ejb-jar.xml contains the following code:



        <ejb-ref >

            <ejb-ref-name>ejb/local/ BarBean </ejb-ref-name>

            <ejb-ref-type>Session</ejb-ref-type>

            <*remote*>example.BarLocal</*remote*>

         </ejb- ref>



Following the FAQ, I would expect the following:



        <ejb-local-ref>

            <ejb-ref-name>ejb/local/ BarBean </ejb-ref-name>

            <ejb-ref-type>Session</ejb-ref-type>

            <*local*>example.BarLocal </*local*>

         </ejb- local-ref>



Can someone tell me what we are doing wrong ?



Kind regards,


Dieter De Meyer.