spring-projects/spring-framework · error · IllegalArgumentException
Invalid method signature: unable to resolve type [${paramete
Error message
Invalid method signature: unable to resolve type [${parameterTypeName}] for argument ${i}. Root cause: ${ex} What it means
Thrown as IllegalArgumentException by resolveSignature when one of the parameter type names inside the argument list cannot be resolved to a Class via ClassUtils.forName using the target class's ClassLoader (BeanUtils.java:473-481). The offending type name, argument index, and root cause are included.
Source
Thrown at spring-beans/src/main/java/org/springframework/beans/BeanUtils.java:479
else if (startParen == -1 && endParen > -1) {
throw new IllegalArgumentException("Invalid method signature '" + signature +
"': expected opening '(' for args list");
}
else if (startParen == -1) {
return findMethodWithMinimalParameters(clazz, signature);
}
else {
String methodName = signature.substring(0, startParen);
String[] parameterTypeNames =
StringUtils.commaDelimitedListToStringArray(signature.substring(startParen + 1, endParen));
Class<?>[] parameterTypes = new Class<?>[parameterTypeNames.length];
for (int i = 0; i < parameterTypeNames.length; i++) {
String parameterTypeName = parameterTypeNames[i].trim();
try {
parameterTypes[i] = ClassUtils.forName(parameterTypeName, clazz.getClassLoader());
}
catch (Throwable ex) {
throw new IllegalArgumentException("Invalid method signature: unable to resolve type [" +
parameterTypeName + "] for argument " + i + ". Root cause: " + ex);
}
}
return findMethod(clazz, methodName, parameterTypes);
}
}
/**
* Retrieve the JavaBeans {@code PropertyDescriptor}s of a given class.
* @param clazz the Class to retrieve the PropertyDescriptors for
* @return an array of {@code PropertyDescriptors} for the given class
* @throws BeansException if PropertyDescriptor look fails
*/
public static PropertyDescriptor[] getPropertyDescriptors(Class<?> clazz) throws BeansException {
return CachedIntrospectionResults.forClass(clazz).getPropertyDescriptors();
}
View on GitHub (pinned to e8729d0438)
Solutions
- Use the fully-qualified type name exactly matching a class resolvable by the target class's ClassLoader.
- Add the missing type's dependency/artifact to the runtime classpath.
- For nested types use 'com.example.Outer$Inner'; for arrays use the JVM notation 'java.lang.String[]' or the canonical form ClassUtils.forName accepts.
- After a rename, update all method-signature strings in config and grep for the old name.
Example fix
// before
resolveSignature("process(com.example.OldName)", clazz); // OldName renamed
// after
resolveSignature("process(com.example.NewName)", clazz); Defensive patterns
Strategy: validation
Validate before calling
String[] parts = sig.substring(sig.indexOf('(')+1, sig.indexOf(')')).split(",");
ClassLoader cl = clazz.getClassLoader();
for (String t : parts) ClassUtils.forName(t.trim(), cl); // throws early if unresolvable Type guard
public static boolean signatureTypesResolvable(Class<?> c, String sig) {
try { BeanUtils.resolveSignature(sig, c); return true; }
catch (IllegalArgumentException e) { return false; }
} Try / catch
try { BeanUtils.resolveSignature(sig, clazz); }
catch (IllegalArgumentException e) {
// message names the unresolvable type; fix config or add the dependency
} Prevention
- Use fully-qualified type names resolvable by the target ClassLoader.
- Keep referenced types and their dependencies on the runtime classpath.
- Use 'Outer$Inner' for nested classes; update signatures after renames.
When it happens
Trigger: resolveSignature('foo(com.example.Missing, java.lang.String)', clazz) where 'com.example.Missing' is not on the classpath, is misspelled, or the classloader cannot load it. Also triggered by array/notational mistakes like 'String[]' spelled incorrectly or unimported nested classes.
Common situations: Refactoring/renaming a class referenced in config without updating the signature string; missing dependency providing the parameter type; using simple names where fully-qualified names are required; nested classes referenced without the enclosing$Inner syntax; multi-module classloader isolation.
Related errors
- Unresolvable class definition
- Invalid method signature '${signature}': expected closing ')
- Invalid method signature '${signature}': expected opening '(
- Specified class is an interface
- Is it an abstract class?
AI-assisted analysis of spring-projects/spring-framework@e8729d0438 (2026-08-04).
Data as JSON: /data/errors/2384f843c15252e1.json.
Report an issue: GitHub.