Code: Select all
A stateless session bean S1 uses another stateless session bean S2 and requests a dependency injection using the following statement (contained in S1's code): @EJB(beanName="ejb/S2", beanInterface=S2Local.class)
S2Local interface is as follows:
package com.enthu.ejbplus;
import javax.ejb.Local;
@Local
public interface S2Local { String m1(); }
Given the above, complete the following S2Bean's code so that bean S1 will work as expected.
package com.enthu.ejbplus;
import javax.annotation.*;
import javax.ejb.*;
// insert lines here...
@Resource SessionContext sctx;
public String m1(){ return "hello!"; } }
@Stateless(name="ejb/S2")
public class S2Bean {