Hi,
After so many days of investigation and repeated failures i found a solution for the above issue which i thought i could end up finding any answer.
I have kept these custom context files under the "classpath:alfresco/extension/custom-web-context.xml" and the changes are picked up after the restart and my custom bean has overridden the OOTB beans.
I have found this information in the web-application-context.xml file under the path <root>\tomcat\webapps\alfresco\WEB-INF
<!-- To give final control over the tuning of the custom environment, the custom-web-context.xml file is processed last (note: custom-web-context.xml isn't part of the source tree itself). --> <import resource="classpath*:alfresco/extension/custom-web-context.xml" />
Hope this helps someone who is looking for an answer.
<import resource="classpath:alfresco/module/${project.artifactId}/context/web-scripts-application-context.xml" />