pinpoint-apm/pinpoint · error · IllegalArgumentException
can not create application. applicationName: ${applicationNa
Error message
can not create application. applicationName: ${applicationName} What it means
ResponseTimeController.createApplication converts request parameters into an Application object via ApplicationFactory; when neither serviceTypeCode nor serviceTypeName is supplied (or neither factory path applies), it logs an error and throws IllegalArgumentException saying the application cannot be created.
Source
Thrown at web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java:379
for (ApplicationPair applicationPair : applicationPairs) {
String applicationName = applicationPair.getApplicationName();
short serviceTypeCode = applicationPair.getServiceTypeCode();
Application application = applicationFactory.createApplication(Service.DEFAULT, applicationName, serviceTypeCode);
applications.add(application);
}
return applications;
}
private Application createApplication(Service service, String applicationName, Short serviceTypeCode, String serviceTypeName) {
if (StringUtils.hasLength(applicationName)) {
if (serviceTypeCode != null) {
return applicationFactory.createApplication(service, applicationName, serviceTypeCode);
} else if (serviceTypeName != null) {
return applicationFactory.createApplicationByTypeName(service, applicationName, serviceTypeName);
}
}
logger.error("can not create application. applicationName: {}, serviceTypeCode: {}, serviceTypeName: {}", applicationName, serviceTypeCode, serviceTypeName);
throw new IllegalArgumentException("can not create application. applicationName: " + applicationName);
}
}
View on GitHub (pinned to 744c3d3075)
Solutions
- Add serviceTypeCode or serviceTypeName as a query parameter for the application
- Use the service type shown next to the application in the Pinpoint UI
- Verify query parameter names (serviceTypeCode/serviceTypeName) and that values are non-empty
Example fix
// before GET /getResponseTime/histogramData?applicationName=myApp&from=...&to=... // after GET /getResponseTime/histogramData?applicationName=myApp&serviceTypeName=TOMCAT&from=...&to=...
Defensive patterns
Strategy: validation
Validate before calling
if (serviceTypeCode == null && (serviceTypeName == null || serviceTypeName === '')) throw new Error('serviceTypeCode or serviceTypeName required to resolve application'); Try / catch
try { ... } catch (IllegalArgumentException e) { if (e.getMessage().contains("can not create application")) { /* add serviceType params */ } else { throw e; } } Prevention
- Always pass serviceTypeName or serviceTypeCode with applicationName
- Reuse a URL builder that includes service type params
- Validate non-empty param values before the call
When it happens
Trigger: Calling response-time endpoints without serviceTypeCode and without serviceTypeName, or with both null while applicationName is set, so applicationFactory is never invoked.
Common situations: API clients omitting the serviceType params after an API change; params passed with empty values; UI/script constructing URLs without the service type for the from/to application.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- Invalid serviceType. ServiceType is required
- application serviceType not found. code:${serviceTypeCode},
- application serviceType not found. code:${serviceTypeCode},
- No service type provided.
- application is not WAS. application:${application}, serviceT
AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07).
Data as JSON: /api/errors/219c25d01a369174.
Report an issue: GitHub.