diff --git a/src/main/java/org/apache/commons/dbutils/AbstractQueryRunner.java b/src/main/java/org/apache/commons/dbutils/AbstractQueryRunner.java index fd433e34..a904e5cb 100644 --- a/src/main/java/org/apache/commons/dbutils/AbstractQueryRunner.java +++ b/src/main/java/org/apache/commons/dbutils/AbstractQueryRunner.java @@ -398,17 +398,14 @@ public void fillStatementWithBean(final PreparedStatement stmt, final Object bea Object value = null; final Method method = property.getReadMethod(); if (method == null) { - throw new RuntimeException("No read method for bean property " - + bean.getClass() + " " + property.getName()); + throw new IllegalArgumentException("No read method for bean property " + bean.getClass() + " " + property.getName()); } try { value = method.invoke(bean); } catch (final IllegalArgumentException e) { - throw new RuntimeException( - "Couldn't invoke method with 0 arguments: " + method, e); + throw new IllegalArgumentException("Couldn't invoke method with 0 arguments: " + method, e); } catch (final InvocationTargetException | IllegalAccessException e) { - throw new RuntimeException("Couldn't invoke method: " + method, - e); + throw new IllegalArgumentException("Couldn't invoke method: " + method, e); } params[i] = value; }