Wildfly by default initializes Filters when they are first accessed by a corresponding http request. This is different to (all) other environments like Tomcat, Jetty. JBoss, BEA, ...
In certain situations this means that the initialization of the CaptainCasa environment (which is part of a Filter init) happens too late.