I have a @WebService class that introduces @EJB. EJB is packaged in a .jar file, which is located in the same .war file as the web service classes. @EJB injection always fails, but I can do a JNDI lookup in EJB. I tried to make EJB and its @Remote interface, but that didn't matter. Injection still doesn't work, and JNDI lookup still works.
I am using version 3.0 of web.xml. There is no ejb deployment descriptor in the ejb.jar file, but this should not matter in EJB 3.1.
Am I missing something or is this a bug in Glassfish?
Here is my code.
The EJB class and interface packaged in a .jar in a .war file:
//@Remote public interface ReportServiceI { public String testAlive(); } @Stateless //@Remote (ReportServiceI.class) public class ReportService implements ReportServiceI {...}
Web Service Class:
@WebService( targetNamespace = "http://www.reps.corp.com/services/reports/ReportService", portName="ReportPort", serviceName="ReportService", endpointInterface="com.corp.reps.reports.ws.server.ReportServiceWSI") public class ReportServiceWS implements ReportServiceWSI { public static Logger logger = Logger.getLogger(ReportServiceWS.class);
source share