Spring Boot Rest Application - Getting Internal Server Error-500 - spring

I am using spring boot and Spring Data JPA in my project.
Sometimes what happens the android or iOS gets Internal Server Error message.
I am not getting what is the exact error. There is no exception logged in log files.
Though I save the request response in database what I get is below
requestPath-/wordpower/error
requestMethhod- GET
ResponseBody-
{timestamp=Mon Mar 02 10:13:54 UTC 2020, status=500, error=Internal Server Error, message=No message available, path=/wordpower/wordpower/v1/getHomeScreenData}
Can anyone help me out what is the problem here?

i got same error when i try to POST request .this error occurs due to same id in a database. by default the new generated id is 1 but if you previously added entiry with id 1 , then this error occurs. solution is simple change the id of previous entity to other than 1.

Related

Quarkus is hiding resteasy exceptions

I have run into a fairly annoying problem with Quarkus, that I cannot figure out how to solve.
I am using quarkus 2.4.1.Final. I am using the quarkus-resteasy-reactive-jackson module to create a REST service.
But when I send the service a post body with a bad format the client simply gets an empty HTTP 400 response back, and nothing is printed in the log on the server side. In this particular case I forgot to add the offset to an OffsetDateTime, so adding "+01:00" makes the service return correctly. Using micrometer metrics, I can see that the endpoint is being hit correctly both when the request is correct and when it isn't.
Hiding an exception from the developer is very close to heresy for me, as I would like to be able to see what the server fails with. I understand that we don't want the stack trace on the client side, but in this case the exception is missing from the server log.
Can anyone help me to convince Quarkus to not swallow my exceptions?

Scheduling a meeting using the MS Teams with non o365 profile (connected to custom server) returns error FailedToGetCalendarFromOutlook

I'm attempting to schedule a meeting using the MS Teams add-in via our MAPI connector, which communicates with the Zimbra server, and I'm receiving the error shown below.
I can use the same user as the O365 user, and everything works fine with exchange profile that talks with exchange server.
I'm not sure what is missing or what needs to be done to get it working.
Any help would be most welcome
09-08:15:31.943 PM 5 Info Microsoft.Teams.MeetingAddin.Scheduler.SchedulerService CreateMeetingAsync This is an on-behalf-of meeting for vikas.galande#synacor.com
2021-06-09-08:15:31.943 PM 5 Info Microsoft.Teams.MeetingAddin.Settings.SettingsBase Lookup Returning default value True for EnableJsonContractResolver setting
2021-06-09-08:15:31.943 PM 5 Info Microsoft.Teams.MeetingAddin.JSONUtilsLogger GetJsonSerializerSettings JSONUtils created JsonSettings
2021-06-09-08:15:35.970 PM 29 Error Microsoft.Teams.MeetingAddin.Scheduler.SchedulerService CreateMeetingAsync Received an error response: Microsoft.Teams.MeetingAddin.Scheduler.MeetingErrorMessage, telemetryId: eaab2650-0599-4fab-ad7f-7821c2dddff2
2021-06-09-08:15:35.970 PM 29 Error Microsoft.Teams.MeetingAddin.Scheduler.SchedulerService CreateMeetingAsync Exception of Type SchedulerServiceException happened. telemetryId: eaab2650-0599-4fab-ad7f-7821c2dddff2
2021-06-09-08:15:35.970 PM 29 Error Microsoft.Teams.MeetingAddin.Scheduler.SchedulerService CreateMeetingAsync
Message:Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details.,StatusCode=Forbidden,ErrorSubCode=FailedToGetCalendarFromOutlook
2021-06-09-08:15:35.971 PM 5 Error Microsoft.Teams.MeetingAddin.Operation.NewMeetingOperation Error Message:Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details.,StatusCode=Forbidden,ErrorSubCode=FailedToGetCalendarFromOutlook
2021-06-09-08:15:35.971 PM 5 Info Microsoft.Teams.MeetingAddin.Errors.ScheduleErrorHandler DisplayError Displaying an error: Title=Microsoft Teams, Message=Sorry, but we can’t connect to the server right now. Please try again later.
Any help is much appreciated.
Thank you.

Spring what is between Controller and Interceptor

I have a controller that is doing something, everything seems fine, it logs a success, and then it does this
return new ResponseEntity<>(resp, HttpStatus.OK);
Seems like it should send a 200 OK.
Well, I also have a HandlerInterceptorAdapter with an "afterCompletion" that logs the status:
logger.debug("Response status: {}, URI: {}", response.getStatus(), request.getRequestURI());
This is showing a 500 where there was a success from the controller.
In the stdout logs I see an error
2018-01-12 12:33:59.035 ERROR 18952 --- [pr-8080-exec-14] o.s.boot.web.support.ErrorPageFilter : Cannot forward to error page for request [/ws/path] as the response has already been committed.
As a result, the response may have the wrong status code. If your application is running on WebSphere Application Server you may be able to resolve this problem by setting com.ibm.ws.webcontainer.invokeFlushAfterService to false
and
org.apache.catalina.connector.ClientAbortException: java.io.IOException: APR error: -32
I can't find any doc on what that APR error is and I have no idea why the status code would be wrong. I am using tomcat 8.5.
So. APR -32 is a "Client Abort" error. The client was timing out in waiting. It looks like what was happening was the client made a request and was sitting in queue for a few seconds. It has a short hard timeout limit. The client timed out before the server got to the request. Then the server picked up the request and did everything fine but when trying to write back to the client, it found the socket closed. So it set a 500 and threw that exception.

Getting Null Exception in GooglePlus Page API

I got an exception frequently while getting and posting activities via GooglePlus Page API. The details are given below:
APIs:
https://www.googleapis.com/plusPages/v2/people/userId/activities/collection
https://www.googleapis.com/plusPages/v2/people/userId/activities
Exception:
{"error":{"message":null,"code":500}}
Can anyone tell me why i am getting the above exception and how to fix this?
I like to call 500 a server hiccup. Normally you can just send the request again and it will work. Why you are getting it only Google knows. Just send it again.
INTERNAL_SERVER_ERROR (500)
Error code Description internalError The request failed due to an
internal error.
You can find it in Googles standard error responses page.

Spring Rest Service getting 400 Bad Request after running 2-3 minutes

I have a rest client and server which we have developed using spring. The client will send requests to the server for 2-3 minutes and then starts getting org.springframework.web.client.HttpClientErrorException: 400 Bad Request errors.
Once the 400 error starts the client is unable to communicate with the server.
Any suggestions would be appreciated.
I will try to develop a working example that creates this error.
I have resolved this issue. The code was setting the following for every call:
// Add the Gson message converter
restTemplate.getMessageConverters().add(new MappingJacksonHttpMessageConverter());
I moved this code to the constructor and no longer getting the 400 Bad Request error.

Resources