diff --git a/schema-registry/core/src/main/java/com/hortonworks/registries/schemaregistry/DefaultSchemaRegistry.java b/schema-registry/core/src/main/java/com/hortonworks/registries/schemaregistry/DefaultSchemaRegistry.java index 6c1dfb689..0b738523a 100644 --- a/schema-registry/core/src/main/java/com/hortonworks/registries/schemaregistry/DefaultSchemaRegistry.java +++ b/schema-registry/core/src/main/java/com/hortonworks/registries/schemaregistry/DefaultSchemaRegistry.java @@ -308,7 +308,8 @@ public void deleteSchema(String schemaName) throws SchemaNotFoundException { } } // Remove all serdes mappings for this schema name - Collection schemaSerDesMappings = getSchemaSerDesMappings(schemaMetadataId); + SchemaMetadataInfo schemaMetadataInfo = getSchemaMetadataInfo(schemaName); + Collection schemaSerDesMappings = getSchemaSerDesMappings(schemaMetadataInfo.getId()); if (schemaSerDesMappings != null) { for (SchemaSerDesMapping schemaSerDesMapping: schemaSerDesMappings) { storageManager.remove(schemaSerDesMapping.getStorableKey());