Skip to content

dubbo-compatible @SPI interface compatible not work #6428

@imsunv

Description

@imsunv
  • Dubbo version: 2.7.7

EG:

SPI interface in apache dubbo

package org.apache.dubbo.common.extension;

/**
 * ExtensionFactory
 */
@SPI
public interface ExtensionFactory {
...
}

compatible class with alibaba dubbo

package com.alibaba.dubbo.common.extension;

@Deprecated
public interface ExtensionFactory extends org.apache.dubbo.common.extension.ExtensionFactory {

}

Not ADD @SPI annotation

    public static <T> ExtensionLoader<T> getExtensionLoader(Class<T> type) {
         .....
        if (!withExtensionAnnotation(type)) {
            throw new IllegalArgumentException("Extension type (" + type +
                    ") is not an extension, because it is NOT annotated with @" + SPI.class.getSimpleName() + "!");
        }
       ....
        return loader;
    }

In ExtensionLoader#getExtensionLoader will check failed and throw Exception.

BTW, ExtensionLoader not provided compatible class.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions