Added log4j and some initialization checks (get context root,...)