apache / apache/dubbo

native-image unit test inject reference bean failed

Open
#13,578 1 comment 0 reactions 0 assignees View on GitHub
component/sdk help wanted type/enhancement
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

- [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 3.3.0-beta.2-SNAPSHOT
* Operating System version: macOS 14.1.2
* Java version: GraalVM Oracle 17.0.9

### Steps to reproduce this issue

1. clone https://github.com/FoghostCn/dubbo-samples/tree/master/2-advanced/dubbo-samples-native-image/
2. run dubbo-samples-native-image-provider first
3. cd /dubbo-samples-native-image-consumer
4. exec `mvn clean test -PnativeTest`

### Expected Behavior

unit test pass

### Actual Behavior

NullPointerException, demoService is not inject, it is null

Contributor guide

Open the contributing guide

Research direction

Clone the linked dubbo-samples repository and inspect 2-advanced/dubbo-samples-native-image, especially the provider and consumer modules. Start by running mvn clean test -PnativeTest in dubbo-samples-native-image-consumer after starting the provider, then trace why demoService is null; done means the native unit test passes with the reference bean injected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.