brettwooldridge/HikariCP · error · RuntimeException

Property %s does not exist on target %s

Error message

Property %s does not exist on target %s

What it means

PropertyElf.setProperty (used for HikariConfig property files / setProperties) reflects a setter named set<PropName> on the target; if none exists it throws RuntimeException 'Property %s does not exist on target'. It means the configuration names a property the config class does not have.

Source

Thrown at src/main/java/com/zaxxer/hikari/util/PropertyElf.java:145

      return null;
   }

   private static void setProperty(final Object target, final String propName, final Object propValue, final List<Method> methods)
   {
      final var logger = LoggerFactory.getLogger(PropertyElf.class);

      // use the english locale to avoid the infamous turkish locale bug
      var methodName = "set" + propName.substring(0, 1).toUpperCase(Locale.ENGLISH) + propName.substring(1);
      var writeMethod = methods.stream().filter(m -> m.getName().equals(methodName) && m.getParameterCount() == 1).findFirst().orElse(null);

      if (writeMethod == null) {
         var methodName2 = "set" + propName.toUpperCase(Locale.ENGLISH);
         writeMethod = methods.stream().filter(m -> m.getName().equals(methodName2) && m.getParameterCount() == 1).findFirst().orElse(null);
      }

      if (writeMethod == null) {
         logger.error("Property {} does not exist on target {}", propName, target.getClass());
         throw new RuntimeException(String.format("Property %s does not exist on target %s", propName, target.getClass()));
      }

      try {
         var paramClass = writeMethod.getParameterTypes()[0];
         String value = propValue.toString();
         if (paramClass == int.class) {
            writeMethod.invoke(target, Integer.parseInt(propValue.toString()));
         }
         else if (paramClass == long.class) {
            writeMethod.invoke(target, parseDuration(value).map(Duration::toMillis).orElseGet(() -> Long.parseLong(value)));
         }
         else if (paramClass == short.class) {
            writeMethod.invoke(target, Short.parseShort(value));
         }
         else if (paramClass == boolean.class || paramClass == Boolean.class) {
            writeMethod.invoke(target, Boolean.parseBoolean(value));
         }
         else if (paramClass.isArray() && char.class.isAssignableFrom(paramClass.getComponentType())) {

View on GitHub (pinned to a4d93f4f85)

Solutions

  1. Check exact spelling/case against HikariConfig setters (maximumPoolSize, connectionTimeout, ...); keys are case-sensitive
  2. Move driver-specific keys (user, serverName, ...) under the dataSourceProperties. prefix or into the dataSource block
  3. Upgrade/downgrade HikariCP to the version whose property set matches your file
  4. Log available properties via PropertyElf.getPropertyNames(HikariConfig.class) when in doubt

Example fix

# before
maximumPoolsize=10
connecitonTimeout=30000

# after
maximumPoolSize=10
connectionTimeout=30000
Defensive patterns

Strategy: validation

Validate before calling

var known = new java.util.HashSet<>(PropertyElf.getPropertyNames(HikariConfig.class));
for (String key : props.stringPropertyNames()) {
    if (!known.contains(key)) throw new IllegalArgumentException("Unknown Hikari property: " + key);
}

Prevention

When it happens

Trigger: Typo in a properties file used with HikariConfig(Properties) (e.g. maximumPoolsize vs maximumPoolSize); a property valid in a newer HikariCP version used against an older jar; passing driver-specific properties at the top level instead of under dataSourceProperties.

Common situations: Version downgrades (property removed/renamed across HikariCP releases), copy-pasted properties with case errors, mixing Hikari properties and driver properties in the same file.

Related errors


AI-assisted analysis of brettwooldridge/HikariCP@a4d93f4f85 (2026-08-14). Data as JSON: /api/errors/ded213dc516dfaa1. Report an issue: GitHub.