Thanks for your reply Stuart,
i have the handler "HAHandler" configured as filter in the undertow subsystem of wildfly.
I also have eager filter initialization on filter enabled.And the Filter init() method is getting called while application deployment and it had set the servletContext.
<filters>
<response-header name="server-header" header-name="Server" header-value="WildFly/10"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
<error-page name="500Handler" path="${jboss.home.dir}/welcome-content/ErrorPage.html" code="506"/>
<error-page name="404Handler" path="${jboss.home.dir}/welcome-content/ErrorPage.html" code="404"/>
<filter name="HAHandler" module="com.haHandler" class-name="com.HAHandler"/>
</filters>
You were correct, by adding some logs, the sevletInitalHandler hadn't added the attachment when my handler was called.
any suggestions how to move my handler in the chain after a specific handler (ServletInitailHandler)?