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

  1. Add serviceTypeCode or serviceTypeName as a query parameter for the application
  2. Use the service type shown next to the application in the Pinpoint UI
  3. 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

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


AI-assisted analysis of pinpoint-apm/pinpoint@744c3d3075 (2026-09-07). Data as JSON: /api/errors/219c25d01a369174. Report an issue: GitHub.