Within RAP, I can also provide a ServletContext object, but the KernelControllerCDFConnector.valid() always return a false value.
How can I solve this issue?
Hmmm, I'm not familiar with RAP.
Which ServletContext instance does this provide?
What we're doing in JBossAS is when creating ServletContext inside JBossWeb/AS code,
we still have access to MC' Kernel and underlying DeploymentUnit,
hence we simply stick it in as an attribute.
* see org.jboss.web.tomcat.service.deployers.JBossContextConfig
Or why using ServletContext?
Can't you push MC layer (aka some MC bean) all the way to RAP layer?
(guessing as I don't know how RAP works ...)