JBoss Community

Re: Calling an EJB from servlet

created by Jan Martiska in EJB3 - View the full discussion

You don't have to put them both into an EAR, but you have to make sure that the servlet will 'see' the EJB's class - in this case the HelloWorld interface is enough- , that means the class will be on the classpath. Deployments are indeed isolated and don't see others' classes.

You may for example copy the HelloWorld interface and put it also into the application with the Servlet.

The enterprise way is to have a separate 'API-jar' containing just the API, in this case the HelloWorld interface, which can be used as a dependency for the application with the Servlet.

Reply to this message by going to Community

Start a new discussion in EJB3 at Community