{"record":{"id":"33c7d288cdb5e355","repo":"pinpoint-apm/pinpoint","slug":"error-creating-filedescriptormetric","errorCode":null,"errorMessage":"Error creating FileDescriptorMetric [{}]","messagePattern":"Error creating FileDescriptorMetric \\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/stat/filedescriptor/FileDescriptorMetricProvider.java","lineNumber":148,"sourceCode":"        if (classToLoad == null) {\n            return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC;\n        }\n        if (UNSUPPORTED_METRIC.equals(classToLoad)) {\n            return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC;\n        }\n\n        try {\n            @SuppressWarnings(\"unchecked\")\n            Class<FileDescriptorMetric> fileDescriptorMetricClass = (Class<FileDescriptorMetric>) Class.forName(classToLoad);\n            try {\n                Constructor<FileDescriptorMetric> fileDescriptorMetricConstructor = fileDescriptorMetricClass.getConstructor();\n                return fileDescriptorMetricConstructor.newInstance();\n            } catch (NoSuchMethodException e) {\n                logger.warn(\"Unknown FileDescriptorMetric : {}\", classToLoad);\n                return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC;\n            }\n        } catch (ReflectiveOperationException e) {\n            logger.warn(\"Error creating FileDescriptorMetric [{}]\", classToLoad);\n            return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC;\n        }\n    }\n}\n","sourceCodeStart":130,"sourceCodeEnd":153,"githubUrl":"https://github.com/pinpoint-apm/pinpoint/blob/744c3d3075e595656abb1ae331ad2c0e4c9eb996/agent-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/context/provider/stat/filedescriptor/FileDescriptorMetricProvider.java#L130-L153","documentation":"FileDescriptorMetricProvider logs this when reflective instantiation of the file-descriptor metric class fails with any ReflectiveOperationException other than the missing-constructor case (e.g. class not found, inaccessible, or constructor threw). The provider falls back to FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC and the agent continues without fd metrics.","triggerScenarios":"Class.forName fails for the platform metric class; setAccessible/instantiation fails; the constructor throws because the OS does not expose the needed MBean.","commonSituations":"Incomplete agent deployment missing Unix/Linux metric classes; exotic platforms where com.sun.unix or OperatingSystemMXBean fd methods are unavailable; wrong agent distribution for the JVM vendor.","solutions":["Inspect the chained ReflectiveOperationException cause in the log to pinpoint load vs instantiate vs constructor-throw","Verify the agent jar contains the platform-specific FileDescriptorMetric classes","Guard the metric constructor against missing MBean methods so it does not throw during instantiation","Switch to a Pinpoint agent build matching your JVM vendor/version, or accept the fallback"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"jar tf pinpoint-agent.jar | grep -i FileDescriptorMetric; // ensure the platform-specific metric class is present before startup","typeGuard":null,"tryCatchPattern":"try { return fileDescriptorMetricConstructor.newInstance(); } catch (ReflectiveOperationException e) { logger.warn(\"Error creating FileDescriptorMetric [{}]\", classToLoad, e); return FileDescriptorMetric.UNSUPPORTED_FILE_DESCRIPTOR_METRIC; }","preventionTips":["Deploy the complete agent distribution; verify jar integrity after transfer","Match the agent build to the JVM vendor (Oracle vs OpenJDK vs others)","Make metric constructors defensive against missing MBean methods","Log full chained stack traces to distinguish load failures from constructor throws"],"tags":["reflection","metrics","class-loading","file-descriptors"],"backgroundTag":"class-not-found","analyzedSha":"744c3d3075e595656abb1ae331ad2c0e4c9eb996","analyzedAt":"2026-09-07T18:48:45.289Z","contentChangedAt":"2026-09-07T18:48:45.289Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}