Fix issue when the application is deployed in an external app server using the production profile and a different context than the default.

bug fix #217