Many smart phone apps, which implement a modern looking user interface, are actually powered by a normal web application behind the scenes that is simply hidden from the user. On the other hand, the server could be the root cause of a Not Acceptable error.
In some cases, the server may be misconfigured and handling requests improperly, which can result in code responses and other problematic traffic routing issues.
In these scenarios, the server is still the network object that is producing the Not Acceptable and returning it as the HTTP response code to the client, but it could be that the client is causing the issue in some way.
As such, it is critical that you perform a full backup of your application, database, and all other components of your website or application before attempting any fixes or changes to the system. This will give you a clean testing ground with which to test all potential fixes to resolve the issue, without threatening the security or sanctity of your live application.
As discussed in the introduction, a Not Acceptable indicates that the user agent the web browser, in most cases has requested a valid resource, however the request included a special Accept- header that indicates to the server a valid response can only contain certain types of information. Here are a few examples of such scenarios:. There are handful of other Accept- headers that can be provided in HTTP requests, but the vast majority of scenarios are similar to above: The user agent wants an explicit type of response, and the server either provides it, or it may return a code indicating it cannot fulfill the request.
Here are a handful of tips to try on the browser or device that is giving you problems. It may be that the requested URL is slightly incorrect, which is causing the user agent to request a specific type of response. Since codes are not as common as codes, the appearance of a could means that the requested URL is valid, but the browser may be misinterpreting the intended request type. The most common content management systems — like WordPress, Joomla!
There are a few tips below aimed at helping you troubleshoot some of these popular software platforms. If you recently updated the content management system itself just before the Not Acceptable appeared, you may want to consider rolling back to the previous version you had installed when things were working fine.
Similarly, any extensions or modules that you may have recently upgraded can also cause server-side issues, so reverting to previous versions of those may also help. In your case, both MediaType. So the first one that matches is used. If you wish to use one over the other, feel free to use quality parameters in your media types; this will be taken into account during the sorting phase:.
Please reopen this issue if you think something is wrong here and how it should behave with respect to the HTTP spec. If it is Spring feature, I think it is better to change them to automatically recognize the returned value format and no exception should be present here. Please tell me if you have any question to be clear. I will explain with more details. OK, so the actual issue is about content negotiation at the ExceptionHandler level. In this case, I'm closing this as a duplicate of , which is more on point.
Skip to content. Star Questions: Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this p Add menu. None of the other answers helped me. We had Spring 4. If you want to change this behavior of Spring, please use the below code: Configuration Import HibernateConfig. Filter Configuration. It worked for me.
Today I too gone through the same issue. In the controller, shouldn't the response body annotation be on the return type and not the method, like so :. I'd also use the raw jquery. On a different note, I find the spring handling of json rather problematic.
If you have added the latest version of Jackson in your pom. Since spring 3. In step 2 I had added the contentNegotiationManager bean to override this. Check as joyfun did for the correct version of jackson but also check our headers Other then the obvious problems I had another one that I couldn't fix regardless of including all possible JARs, dependancies and annotations in Spring servlet. Eventually I found that I have wrong file extension by that I mean I had two separate servlet running in same container and I needed to map to different file extensions where one was ".
I had the same problem unfortunately non of the solution here solved my problem as my problem was something in a different class. I then updated to from Spring 4. It was Request processing failed; nested exception is java. IllegalArgumentException: No converter found for return value of type. For some reason spring was not able to determine the how to convert UploadPictureReslt when it extended WebResponse.
I guess spring does an 'contains check' rather than exact match for accept headers. But still, worth a try to remove the headers element and check. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 10 years, 2 months ago. Active 2 years, 3 months ago. Viewed k times. Any suggestions? Feel free to ask questions Improve this question. Jaanus Jaanus Add a comment. Active Oldest Votes.
Improve this answer. Community Bot 1 1 1 silver badge.
0コメント