Fehlmann and Gardiner considered the obstacle problem which asks what embedding of a Riemann surface S of finite topological type minus an obstacle E into another surface R of the same type which induces the isomorphisms π1(S)->π1(R) of the fundamental groups does maximize the L1-norm of the holomorphic quadratic differential on R corresponding to a given one on S under the heights mapping. In this paper we consider obstacles with arbitrarily many connected components while they considered the case where the obstacle has finitely many components. As an application we give a slit mapping theorem of an open Riemann surface of finite genus.