fixed ClassCastException and logging statement

Signed-off-by: Kai Kreuzer <kai@openhab.org>