Jody Garnett (
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ae422bb7f-4808-47e3-837f-13db0e6681e3
) *created* an issue
GeoServer (
https://osgeo-org.atlassian.net/browse/GEOS?atlOrigin=eyJpIjoiOWIxMzJkZGE1MGM2NDcyN2IyNmM2OGE4OThlNWJmMDciLCJwIjoiaiJ9
) / Bug (
https://osgeo-org.atlassian.net/browse/GEOS-10522?atlOrigin=eyJpIjoiOWIxMzJkZGE1MGM2NDcyN2IyNmM2OGE4OThlNWJmMDciLCJwIjoiaiJ9
) GEOS-10522 (
https://osgeo-org.atlassian.net/browse/GEOS-10522?atlOrigin=eyJpIjoiOWIxMzJkZGE1MGM2NDcyN2IyNmM2OGE4OThlNWJmMDciLCJwIjoiaiJ9
) Failure in @ExceptionHandler No input String specified (
https://osgeo-org.atlassian.net/browse/GEOS-10522?atlOrigin=eyJpIjoiOWIxMzJkZGE1MGM2NDcyN2IyNmM2OGE4OThlNWJmMDciLCJwIjoiaiJ9
)
Issue Type: Bug Assignee: Unassigned Components: REST Created: 01/Jun/22 8:20
PM Environment:
Docer / Ubuntu / Java 8
Logging of requests enabled
Priority: Medium Reporter: Jody Garnett (
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Ae422bb7f-4808-47e3-837f-13db0e6681e3
)
I am trouble shooting a failure in the REST API where exceptions are being
gobbled up and not reported.
01 009 18:09:54 WARN [annotation.ExceptionHandlerExceptionResolver] - Failure
in @ExceptionHandler
org.geoserver.rest.RestControllerAdvice#handleGeneralException(Exception,
HttpServletRequest, HttpServletResponse, OutputStream)
java.lang.IllegalArgumentException: No input String specified
at org.springframework.util.Assert.notNull(Assert.java:201)
at org.springframework.util.StreamUtils.copy(StreamUtils.java:142)
at
org.geoserver.rest.RestControllerAdvice.handleGeneralException(RestControllerAdvice.java:126
The above warning is due to not performing a null check on e.getMessage() :
public void handleGeneralException(
Exception e, HttpServletRequest request, HttpServletResponse
response, OutputStream os)
throws Exception {
// if there is a OGC request active, the exception was not meant for
this dispatcher,
// nor it was if it's a security exception, in this case let servlet
filters handle it
// instead
if (Dispatcher.REQUEST.get() != null
|| e instanceof AuthenticationException
|| e instanceof AccessDeniedException) {
throw e;
}
LOGGER.log(Level.SEVERE, e.getMessage(), e);
notifyExceptionToCallbacks(request, response, e);
response.setStatus(500);
response.setContentType(MediaType.TEXT_PLAIN_VALUE);
StreamUtils.copy(e.getMessage(), StandardCharsets.UTF_8, os);
}
(
https://osgeo-org.atlassian.net/browse/GEOS-10522#add-comment?atlOrigin=eyJpIjoiOWIxMzJkZGE1MGM2NDcyN2IyNmM2OGE4OThlNWJmMDciLCJwIjoiaiJ9
) Add Comment (
https://osgeo-org.atlassian.net/browse/GEOS-10522#add-comment?atlOrigin=eyJpIjoiOWIxMzJkZGE1MGM2NDcyN2IyNmM2OGE4OThlNWJmMDciLCJwIjoiaiJ9
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100199-
sha1:4212c97 )
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel