[jboss-user] [EJB3] - Re: Calling an EJB from servlet

Jan Martiska do-not-reply at jboss.com
Thu Dec 13 10:02:45 EST 2012

Jan Martiska [https://community.jboss.org/people/jmartisk] created the discussion

"Re: Calling an EJB from servlet"

To view the discussion, visit: https://community.jboss.org/message/783296#783296

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121213/f265be2b/attachment.html 

More information about the jboss-user mailing list