pinpoint-apm/pinpoint · error · IllegalArgumentException
unsupported type:
Error message
unsupported type:
What it means
ParameterUtils.checkParameterType validates that the types passed for a TransformCallback constructor are supported: null is rejected and each class must be one of the supported parameter types (e.g. InstrumentContext or a primitive/wrapper/array allowed by the instrumentation API). Passing an unsupported class triggers this IllegalArgumentException.
Source
Thrown at agent-module/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/instrument/transformer/ParameterUtils.java:108
// return;
// }
// if (clazz.getClassLoader() != Object.class.getClassLoader()) {
// throw new IllegalArgumentException("unsupported classloader " + clazz);
// }
clazz = getRawComponentType(clazz);
if (clazz.isPrimitive()) {
return;
}
boolean supportedClass = false;
for (Class<?> supportClass : SUPPORT_CLASS) {
if (supportClass.isAssignableFrom(clazz)) {
supportedClass = true;
break;
}
}
if (!supportedClass) {
throw new IllegalArgumentException("unsupported type:" + clazz);
}
}
}
static Class<?> getRawComponentType(Class<?> aClass) {
while (aClass.isArray()) {
aClass = aClass.getComponentType();
}
return aClass;
}
}
View on GitHub (pinned to 744c3d3075)
Solutions
- Use only supported parameter types: Class, String, integer/wrapper primitives, and InstrumentContext per the API contract
- Pass types loadable by the bootstrap/profiler classloader (java.* or pinpoint bootstrap classes), not application classes
- Check the ParameterUtils source for your Pinpoint version to confirm which types are supported
Example fix
// before
transformer.transform("com.foo.Bar", MyCallback.class, new Object[]{new Bar()}, new Class[]{Bar.class}); // throws
// after
transformer.transform("com.foo.Bar", MyCallback.class, new Object[]{"name"}, new Class[]{String.class}); Defensive patterns
Strategy: validation
Validate before calling
static final Set<Class<?>> SUPPORTED = Set.of(Class.class, String.class, int.class, Integer.class, long.class, Long.class, boolean.class, Boolean.class);
boolean validParams = Arrays.stream(parameterTypes).allMatch(t -> t != null && SUPPORTED.contains(t));
if (!validParams) throw new IllegalArgumentException("unsupported transform parameter type"); Try / catch
try {
transformer.transform(name, cb, params, types);
} catch (IllegalArgumentException e) {
if (e.getMessage().startsWith("unsupported type:")) {
logger.error("unsupported transform parameter type; use String/int/wrapper/Class or InstrumentContext", e);
} else { throw e; }
} Prevention
- Restrict transform callback constructor args to the documented supported types
- Never pass application classes as transform parameters (bootstrap classloader cannot resolve them)
- Re-check supported types when upgrading Pinpoint versions
When it happens
Trigger: Calling TransformTemplate.transform(className, callbackClass, parameters, parameterTypes) with a parameterTypes entry that is neither null-checked-supported nor assignable to any supported class in the supportClass list.
Common situations: Passing arbitrary application classes as transform callback constructor arguments; passing an interface or user type the bootstrap classloader cannot resolve; version drift where a formerly accepted type was removed from the supported list.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- Invalid time unit provided.
- Unsupported locale: ${localeKey}
- BracketMatcherOperator is not an operation target.
- transformCallbackClass must be static inner class. class:
- constructor not found
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/3a5f3086ff1cb6fc.
Report an issue: GitHub.