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
SLING-12027 - GraphQL core fails to build with Java 17 #38
Conversation
Upgrade to the latest Mockito
Update to the latest version of o.a.f.framework
Update to the latest version of o.a.s.testing.paxexam
Build with Java 17 again
@raducotescu @schaefa - I think this is mostly done, but one test fails and it requires more GraphQL insight
It would be great if you could look into this so we can have Java 17 compatibility for this bundle. |
@rombert I will check it out |
There is a problem where the initial Error Code of 400 is turned into an Internal Server Error (500). This is happening between setting the error code SlingServletResolver.handleError() line 387 and obtaining the Error Code in DefaultErrorHandlerServlet.service() line 70. Because it cannot find it it will set the error code to 500. |
@schaefa, the code fails on Java 11 in the same way, which means that there is a bug or a behaviour change in one of the updated libraries. |
@@ -249,7 +249,7 @@ | |||
<dependency> | |||
<groupId>org.apache.sling</groupId> | |||
<artifactId>org.apache.sling.testing.paxexam</artifactId> | |||
<version>3.1.0</version> | |||
<version>4.0.0</version> |
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.
This seems to be the culprit of the failing test.
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.
I added this for Java 17 support, see https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=255071690#CommonIssueswhenbuildingwithnewerJDKs(11or17)-Pax-Examtestfailures
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.
This update brought org.apache.felix.jetty-5.0.0
, which uses Jetty 11. Unfortunately, there's a Servlet Request Wrapper in Felix that doesn't correctly return the set attributes if they were RequestDispatcher
attributes - see https://github.com/apache/felix-dev/blob/d691a59c9e78749fad20a10a002c969e4e583800/http/wrappers/src/main/java/org/apache/felix/http/javaxwrappers/ServletRequestWrapper.java#L108-L182
@cziegeler will fix this in Felix and for this test setup we could override the Jetty version.
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.
Nice catch!
* use o.a.felix.http.jetty 4.x until FELIX-6656 is fixed * cleaned some redundant dependencies, now that we updated to o.a.sling.testing.paxexam 4.0.0
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Thanks @schaefa , @raducotescu , @cziegeler for your help, this has been a fun ride :-) |
No description provided.