fixed java based config and added bean lifecycle related init and destroy methods