The runtime type of the ServletContext instance is org.eclipse.equinox.http.servlet.internal.ServletContextAdaptor.So that must be the cause the valid() method gives false.
Perhaps see if you can then tie this ServletContextAdaptor with MC.
e.g. putting the same Kernel and DeploymentUnit attributes in
(or at least Kernel, as that's what you need)
Then your code wouldn't need any change. :-)