apache / shenyu

Apache ShenYu is a Java native API Gateway for service proxy, protocol conversion and API governance.
https://shenyu.apache.org/
Apache License 2.0
8.46k stars 2.94k forks source link

[Question] Dubbo proxy occurs NullPointerException, have no "dubbo" Decorator #4836

Open annie-jpg opened 1 year ago

annie-jpg commented 1 year ago

Question

When i use the shenyu to proxy dubbo service and then call the gateway interface.

java.lang.NullPointerException: null at org.apache.shenyu.plugin.global.DefaultShenyuContextBuilder.build(DefaultShenyuContextBuilder.java:61) ~[shenyu-plugin-global-2.5.1.jar:2.5.1] Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:

image The decoratorMap just have http. When the DubboShenyuContextDecorator was added to this map?

maybe i miss some dependencies ... but i can't find it in document.

yu199195 commented 1 year ago

you add dubbo plugin?

annie-jpg commented 1 year ago

you add dubbo plugin?

yes!

    <dependency>
        <groupId>org.apache.shenyu</groupId>
        <artifactId>shenyu-spring-boot-starter-client-apache-dubbo</artifactId>
        <version>${shenyu.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.dubbo</groupId>
        <artifactId>dubbo</artifactId>
        <version>${dubbo.version}</version>
    </dependency>
    <!-- Dubbo zookeeper registry dependency start -->
    <dependency>
        <groupId>org.apache.dubbo</groupId>
        <artifactId>dubbo-dependencies-zookeeper</artifactId>
        <version>${dubbo.version}</version>
        <type>pom</type>
    </dependency>
    <!-- Dubbo zookeeper registry dependency end -->

anything else required?

yu199195 commented 1 year ago
<dependency>
        <groupId>org.apache.shenyu</groupId>
        <artifactId>shenyu-spring-boot-starter-plugin-apache-dubbo</artifactId>
        <version>${shenyu.version}</version>
 </dependency>
annie-jpg commented 1 year ago
<dependency>
        <groupId>org.apache.shenyu</groupId>
        <artifactId>shenyu-spring-boot-starter-plugin-apache-dubbo</artifactId>
        <version>${shenyu.version}</version>
 </dependency>

awesome! i suggest updating the document.