-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JDK17 and springboot 3.0 support #975
Conversation
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
…o support jdk17 Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
…rectory, not test source and generated source Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
…ions before 3.0 Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. waiting for tests to pass
sdk-tests/src/test/java/io/dapr/it/tracing/http/OpenTelemetryInterceptor.java
Show resolved
Hide resolved
The examples should work. Rerunning it to see if it was flakiness. |
Validation of examples is failing. |
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
…fklow Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
I'm confused by the behavior of NOP Logger and logback. Before this PR, examples subproject in java-sdk repo depends on springboot2.x and introduced logback as its slf4j implementation: [INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.7.8:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.7.8:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.7.8:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.2.11:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.2.11:compile In this PR, I updated the version of springboot to springboot 3.0, also introduced logback as its slf4j implementation: [INFO] +- org.springframework.boot:spring-boot-starter-web:jar:3.0.13:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:3.0.13:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:3.0.13:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.4.11:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.4.11:compile But now the github action failed because of the conflicts between logback and NOP logger from slf4j-api: == APP == ... 8 more
== APP == Caused by: java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.helpers.NOPLoggerFactory loaded from jar:file:/home/runner/work/java-sdk/java-sdk/examples/target/dapr-java-sdk-examples-exec.jar!/BOOT-INF/lib/slf4j-api-1.7.25.jar!/). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.helpers.NOPLoggerFactory We used NOP logger in workflow, in DaprWorkflowContextImpl: public Logger getLogger() {
if (this.innerContext.getIsReplaying()) {
return NOPLogger.NOP_LOGGER;
}
return this.logger;
} The problem is that it works with jdk11 + springboot2.x (before this PR), but it doesn't work with jdk17 + springboot3.0. I tried to exclude logback from examples subproject to fix above conflicts, then all the examples will pass exception workflow example: withtout logback, only NOP logger it can't output the text for validation. == APP == SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
== APP == SLF4J: Defaulting to no-operation (NOP) logger implementation
== APP == SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. I also checked other examples to see why they didn't fail without logback, there are
|
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Done! <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.9</version>
</dependency> After adding slf4j-api as compile dependency and upgrade its version to 2.0.9, then logback and NOP logger can work together. @artursouza @mukundansundar This PR can be merged now! |
Signed-off-by: Sky Ao <aoxiaojian@gmail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #975 +/- ##
=========================================
Coverage 77.31% 77.31%
Complexity 1537 1537
=========================================
Files 143 143
Lines 4642 4642
Branches 541 541
=========================================
Hits 3589 3589
Misses 778 778
Partials 275 275 ☔ View full report in Codecov by Sentry. |
Description
Upgrade to add springboot 3.0 support in dapr java sdk.
For the details, please reference to the proposal: #971
Issue reference
#971
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: