private static void printFieldsInfo(Object object)
			throws IllegalArgumentException, IllegalAccessException,
			SecurityException, NoSuchMethodException, InvocationTargetException {

		Class<?> actualClass = object.getClass();

		while (actualClass != Object.class) {

			for (Field field : actualClass.getDeclaredFields()) {

				// don't print static variables
				if (Modifier.isStatic(field.getModifiers())) {
					continue;
				}

				Boolean fieldAccess = field.isAccessible();
				field.setAccessible(true);
				Object fieldObj = field.get(object);
				field.setAccessible(fieldAccess);

				System.err.print(field.toString());

				if (fieldObj != null && fieldObj.getClass().isArray()) {

					System.err.print(" = [ ");

					for (int i = 0; i < Array.getLength(fieldObj); i++) {
						System.err.print(Array.get(fieldObj, i) + " ");
					}
					System.err.println("];");

				} else {
					System.err.println(" = " + fieldObj + ";");
				}

			}

			actualClass = actualClass.getSuperclass();

		}

	}