Skip to content

dubbo-compatible @SPI interface compatible not work #6428

Closed

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.

Activity

  1. added this to the 2.7.9 milestone on Jul 8, 2020
  2. self-assigned this
    on Jul 8, 2020
  3. modified the milestones: 2.7.9, 2.7.8 on Jul 8, 2020
  4. chickenlj commented on Jul 8, 2020

    @chickenlj
    Contributor

    Not ADD @SPI annotation

    I've added @SPI to alibaba.ExtensionFactory in #6436

    BTW, ExtensionLoader not provided compatible class.

    Why do we need a compatible ExtensionLoader, could you please further explain?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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