{"record":{"id":"bb3faee3570ddafb","repo":"openzipkin/zipkin","slug":"category-null","errorCode":null,"errorMessage":"category == null","messagePattern":"category == null","errorType":"validation","errorClass":"NullPointerException","httpStatus":null,"severity":"error","filePath":"zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/ScribeCollector.java","lineNumber":52,"sourceCode":"      delegate.storage(storage);\n      return this;\n    }\n\n    @Override public Builder metrics(CollectorMetrics metrics) {\n      if (metrics == null) throw new NullPointerException(\"metrics == null\");\n      this.metrics = metrics.forTransport(\"scribe\");\n      delegate.metrics(this.metrics);\n      return this;\n    }\n\n    @Override public Builder sampler(CollectorSampler sampler) {\n      delegate.sampler(sampler);\n      return this;\n    }\n\n    /** Category zipkin spans will be consumed from. Defaults to \"zipkin\" */\n    public Builder category(String category) {\n      if (category == null) throw new NullPointerException(\"category == null\");\n      this.category = category;\n      return this;\n    }\n\n    /** The port to listen on. Defaults to 9410 */\n    public Builder port(int port) {\n      this.port = port;\n      return this;\n    }\n\n    @Override public ScribeCollector build() {\n      return new ScribeCollector(this);\n    }\n  }\n\n  final NettyScribeServer server;\n\n  ScribeCollector(Builder builder) {","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-collector/scribe/src/main/java/zipkin2/collector/scribe/ScribeCollector.java#L34-L70","documentation":"ScribeCollector.Builder.category(String) throws a NullPointerException with message 'category == null' when the category name used to filter Scribe messages is set to null. The category is the Finagle/Scribe log category (default 'zipkin') from which the collector consumes spans. Zipkin fails fast here because a null category cannot be subscribed to and would otherwise fail later at runtime in the Scribe protocol handler.","triggerScenarios":"Calling ScribeCollector.newBuilder().category(null), or passing a variable that was never initialized (e.g. a config property that resolved to null via System.getenv or a properties file) into .category(...).","commonSituations":"Wiring the Scribe collector from environment variables or Spring property placeholders where the category key is misspelled or absent; refactoring code that previously hardcoded 'zipkin'.","solutions":["Pass a non-null category string, typically the default \"zipkin\": builder.category(\"zipkin\")","If the category comes from config, default it when absent: builder.category(category != null ? category : \"zipkin\")","Check the property name/env var spelling that supplies the category value"],"exampleFix":"// before\nString cat = System.getenv(\"SCRIBE_CATEGORY\"); // null if unset\nScribeCollector collector = ScribeCollector.newBuilder().category(cat).port(9410).build();\n\n// after\nString cat = System.getenv(\"SCRIBE_CATEGORY\");\nif (cat == null) cat = \"zipkin\";\nScribeCollector collector = ScribeCollector.newBuilder().category(cat).port(9410).build();","handlingStrategy":"validation","validationCode":"String category = System.getenv(\"SCRIBE_CATEGORY\");\nif (category == null) category = \"zipkin\";\n// now safe: ScribeCollector.newBuilder().category(category)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default optional string builder parameters at the config-binding layer before they reach builders","Keep builder calls in one factory method so null defaults are applied in exactly one place"],"tags":["zipkin","scribe","collector","null-check","configuration"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}