question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] ShenyuDubboService, but `IllegalArgumentException: Annotation must not be null`

See original GitHub issue

Question

https://github.com/apache/shenyu/blob/8c4c530206e36be531fed7a323025c5cc592af2b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboClassMultiParamServiceImpl.java#L35

java.lang.IllegalArgumentException: Annotation must not be null
	at org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationPostProcessor.processScannedBeanDefinition(ServiceAnnotationPostProcessor.java:334) ~[dubbo-3.0.8.jar:3.0.8]
org.apache.dubbo.config.spring.beans.factory.annotation.ServiceAnnotationPostProcessor#processScannedBeanDefinition

Annotation service = findServiceAnnotation(beanClass);

    private final static List<Class<? extends Annotation>> serviceAnnotationTypes = asList(
            // @since 2.7.7 Add the @DubboService , the issue : https://github.com/apache/dubbo/issues/6007
            DubboService.class,
            // @since 2.7.0 the substitute @com.alibaba.dubbo.config.annotation.Service
            Service.class,
            // @since 2.7.3 Add the compatibility for legacy Dubbo's @Service , the issue : https://github.com/apache/dubbo/issues/4330
            com.alibaba.dubbo.config.annotation.Service.class
    );

findServiceAnnotation return null because serviceAnnotationTypes

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
AlbumenJcommented, Oct 12, 2022

The @AlisFor is from spring 4.2+, maybe dubbo needs to be more compatible with this?

https://github.com/apache/dubbo/pull/10737

0reactions
dragon-zhangcommented, Oct 11, 2022

Dubbo use org.apache.dubbo.common.utils.AnnotationUtils#findAnnotation(java.lang.reflect.AnnotatedElement, java.lang.Class<A>) for spring 3.2.x compatible purpose.

The @AlisFor is from spring 4.2+, maybe dubbo needs to be more compatible with this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

IllegalArgumentException: Type cannot be null - Stack Overflow
This represents a problem in our Java data access framework, not the underlying data access infrastructure. UPDATE 1. If I change the repository ......
Read more >
Service name must not be null or empty #73 - GitHub
IllegalArgumentException: Service name must not be null or empty. The service name should be check if and only if the enabled flag is...
Read more >
How IntelliJ IDEA played a dirty trick on me - Manu Sobles
IllegalArgumentException but was: java.lang.NullPointerException: Parameter 'str' must not be null at java.util.Objects.requireNonNull(Objects.
Read more >
Hibernate Tips: Difference between @Column(nullable = false ...
Question: One of my entity attributes shall not be null. There seem to be 2 different ways to ensure that. I can either...
Read more >
Predefined Annotation Types - Java™ Tutorials
@Deprecated @Deprecated annotation indicates that the marked element is deprecated and should no longer be used. The compiler generates a warning whenever a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found