if the service is running in a different container from the one which invokes it, you will have to use expose your service as a Servlet, use a protocol such as SOAP or create a JSON/REST interface for your service.
if the service is running in a different container from the one which invokes it, you will have to use expose your service as a Servlet, use a protocol such as SOAP or create a JSON/REST interface for your service.