Skip to content
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

Failed LOG.debug() with MultiPart #11281

Closed
joakime opened this issue Jan 17, 2024 · 0 comments · Fixed by #11313
Closed

Failed LOG.debug() with MultiPart #11281

joakime opened this issue Jan 17, 2024 · 0 comments · Fixed by #11313
Assignees
Labels
Bug For general bugs on Jetty side
Milestone

Comments

@joakime
Copy link
Contributor

joakime commented Jan 17, 2024

Jetty version(s)
12

Jetty Environment
Any

Java version/vendor (use: java -version)
Any

OS type/version
Any

Description
When Logging is set to DEBUG during testing of jetty-server's MultiPart behaviors a few exception show up that indicate a problem logging at DEBUG level due to exceptions during .toString()

SLF4J: Failed toString() invocation on an object of type [org.eclipse.jetty.http.MultiPart$ChunksPart]
Reported exception:
java.lang.NullPointerException: Cannot invoke "org.eclipse.jetty.io.Content$Source.getLength()" because the return value of "org.eclipse.jetty.http.MultiPart$Part.getContentSource()" is null
	at org.eclipse.jetty.http@12.0.6-SNAPSHOT/org.eclipse.jetty.http.MultiPart$Part.getLength(MultiPart.java:229)
	at org.eclipse.jetty.http@12.0.6-SNAPSHOT/org.eclipse.jetty.http.MultiPart$ChunksPart.toString(MultiPart.java:448)
	at org.slf4j@2.0.9/org.slf4j.helpers.MessageFormatter.safeObjectAppend(MessageFormatter.java:291)
	at org.slf4j@2.0.9/org.slf4j.helpers.MessageFormatter.deeplyAppendParameter(MessageFormatter.java:263)
	at org.slf4j@2.0.9/org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:225)
	at org.slf4j@2.0.9/org.slf4j.helpers.MessageFormatter.arrayFormat(MessageFormatter.java:160)
	at org.eclipse.jetty.logging@12.0.6-SNAPSHOT/org.eclipse.jetty.logging.StdErrAppender.format(StdErrAppender.java:162)
	at org.eclipse.jetty.logging@12.0.6-SNAPSHOT/org.eclipse.jetty.logging.StdErrAppender.emit(StdErrAppender.java:93)
	at org.eclipse.jetty.logging@12.0.6-SNAPSHOT/org.eclipse.jetty.logging.JettyLogger.emit(JettyLogger.java:631)
	at org.eclipse.jetty.logging@12.0.6-SNAPSHOT/org.eclipse.jetty.logging.JettyLogger.debug(JettyLogger.java:172)
	at org.eclipse.jetty.http@12.0.6-SNAPSHOT/org.eclipse.jetty.http.MultiPart$Part.fail(MultiPart.java:339)
	at org.eclipse.jetty.http@12.0.6-SNAPSHOT/org.eclipse.jetty.http.MultiPart$ChunksPart.fail(MultiPart.java:437)
	at org.eclipse.jetty.http@12.0.6-SNAPSHOT/org.eclipse.jetty.http.MultiPart$Part.close(MultiPart.java:316)
	at org.eclipse.jetty.util@12.0.6-SNAPSHOT/org.eclipse.jetty.util.IO.close(IO.java:444)
	at org.eclipse.jetty.util@12.0.6-SNAPSHOT/org.eclipse.jetty.util.IO.close(IO.java:459)
	at org.eclipse.jetty.http@12.0.6-SNAPSHOT/org.eclipse.jetty.http.MultiPartFormData$Parts.close(MultiPartFormData.java:166)
	at org.eclipse.jetty.server@12.0.6-SNAPSHOT/org.eclipse.jetty.server.handler.MultiPartFormDataHandlerTest.testAsyncMultiPartResponse(MultiPartFormDataHandlerTest.java:264)
2024-01-16 21:54:44.881:DEBUG:oejh.MultiPart:ForkJoinPool-1-worker-4: Error closing part [FAILED toString()]
java.lang.NullPointerException: Cannot invoke "org.eclipse.jetty.io.Content$Source.fail(java.lang.Throwable)" because the return value of "org.eclipse.jetty.http.MultiPart$Part.getContentSource()" is null
	at org.eclipse.jetty.http@12.0.6-SNAPSHOT/org.eclipse.jetty.http.MultiPart$Part.fail(MultiPart.java:323)
	at org.eclipse.jetty.http@12.0.6-SNAPSHOT/org.eclipse.jetty.http.MultiPart$ChunksPart.fail(MultiPart.java:437)
	at org.eclipse.jetty.http@12.0.6-SNAPSHOT/org.eclipse.jetty.http.MultiPart$Part.close(MultiPart.java:316)
	at org.eclipse.jetty.util@12.0.6-SNAPSHOT/org.eclipse.jetty.util.IO.close(IO.java:444)
	at org.eclipse.jetty.util@12.0.6-SNAPSHOT/org.eclipse.jetty.util.IO.close(IO.java:459)
	at org.eclipse.jetty.http@12.0.6-SNAPSHOT/org.eclipse.jetty.http.MultiPartFormData$Parts.close(MultiPartFormData.java:166)
	at org.eclipse.jetty.server@12.0.6-SNAPSHOT/org.eclipse.jetty.server.handler.MultiPartFormDataHandlerTest.testAsyncMultiPartResponse(MultiPartFormDataHandlerTest.java:264)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant