Skip to content

With @Reference, Aop does not work #5446

@shihuili1218

Description

@shihuili1218
  • 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.6.0
  • Operating System version: windows10
  • Java version: 1.8

Steps to reproduce this issue

When an Aop pointcut is an interface:

  1. With @reference, Aop does not work
  2. Using XML with @autowire, Aop works fine

当Aop切入点是接口时:

  1. 使用@reference,Aop不生效
  2. 使用xml配合@Autowired,Aop正常工作

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

package com.xxxx.service;
public interface XxxxService {
    DicResponseDTO<List<String>> getAllFormKey();
}

-------------------------

@Aspect
@Component
public class XxxAspect {
   @Around("execution(* com.xxxx.service.*.*(..))")
    public Object aroundApi(ProceedingJoinPoint pjp) throws Throwable {
    }
}

-------------------------------------

@RestController
public class TestController {

    /**
    *<dubbo:reference interface="com.xxxx.service.XxxxService" id="xxxService" check="false"
    *                     timeout="5000" retries="-1"/>
    **/
    @Autowired
    private XxxxService xxxxService;

    @Reference
    private XxxxService xxxxServiceRe;

    @RequestMapping("test")
    public void ss() {
        Object allFormKey =
                xxxxService.getAllFormKey();
    }
}

Expected Result

What do you expected from the above steps?

Expectation: With @reference, Aop works fine
期望:使用@reference,Aop能正常工作

Actual Result

What actually happens?

With @reference, Aop does not work
使用@reference,Aop不生效

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions