java api get image position

image.getPosition().X gives: com.sun.star.uno.RuntimeException: position cannot be determined with this method.
So, with which method can it be determined?
My code:

		XModel xModel = UnoRuntime.queryInterface(XModel.class, xDoc);
		XDrawPageSupplier xDPS = UnoRuntime.queryInterface(XDrawPageSupplier.class, xModel);
		XDrawPage xDrawPage = xDPS.getDrawPage();
		XShapes xShapes = UnoRuntime.queryInterface(XShapes.class, xDrawPage);
		for (int s = 0; s < xDrawPage.getCount(); s++) {
			XShape xShape = UnoRuntime.queryInterface(XShape.class, xShapes.getByIndex(s));
			int x = xShape.getPosition().X; // ERROR HERE
		}