Skip to content

DubboComponentScan cannot backward support for alibaba @Service and @Reference. #4330

Closed
@haiyang1985

Description

@haiyang1985
  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.2
  • Operating System version: macOs
  • Java version: JDK 1.8

Steps to reproduce this issue

  1. Currently, my dubbo service is beyond 2.5.10, and going to upgrade 2.7.2. The build system errors me that DubboComponentScan is not exists in alibaba package, then select to auto-import apache one.
import org.apache.dubbo.config.spring.context.annotation.DubboComponentScan;
@SpringBootApplication
@DubboComponentScan
public class ServiceInitializer extends SpringBootServletInitializer {
  @Override
  protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
    return application.sources(ServiceInitializer.class);
  }
}
  1. I have forgot to switch @service from alibaba to apache one. The IDE's alert doesn't obviously, and build system doesn't stop the build.
import com.alibaba.dubbo.config.annotation.Service;
@Service
public class DemoServiceImpl implements DemoService {
  @Override
  public String sayHello(String name) {
    return "welcome,"+name;
  }
}
  1. The application is running without error message, but service have not been started.

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

The DubboComponentScan should backward compatible with alibaba @service and @reference.

Actual Result

It's incompatible with alibaba @service and @reference.

If there is an exception, please attach the exception trace:

The service have not thrown any exception, consumer will throw no provider exception as service not started.

Metadata

Metadata

Assignees

Labels

type/bugBugs to being fixed

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions