Error creating bean with name ‘requestMappingHandlerAdapter’

Am creating a simple REST service using Springframework with Tomcat. The response should have to be in json like {“id”:”101″,”name”:”Ram”} .When ever I run, am getting the following error org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘requestMappingHandlerAdapter’ defined in class org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.requestMappingHandlerAdapter()] threw exception; … Read more

Spring: Different exception handler for RestController and Controller

In Spring you can set up “global” exception handler via @ControllerAdvice and @ExceptionHandler annotation. I’m trying to utilize this mechanism to have two global exception handlers: RestControllerExceptionHandler – which should return error responses as json for any controller annotated with @RestController ControllerExceptionHandler – which should print error message to the screen for any other controller … Read more

Posting form data to MVC Core API

I would like to post data to my API using AJAX but I’m having issues. I’m using Fiddler to test my API and I’m able to post JSON correctly but when posting a name/value urlencoded string I get a 400 Bad Request with the response body being ‘{“”:[“The input was not valid.”]}’. My debug window … Read more

REST authentication / authorization

I need some advices on how to secure my application: I have a REST service, using Spring MVC 3 I have my client application, using Ext GWT 2.2 Users credentials are available on the server side only. SSL available REST services should only be used by authentificated users. I have read about HTTP Digest , … Read more

How can I access my local REST api from my android device?

I have a spring REST api running locally on my computer. I would like to consume this api for android development. Here is my get request: public static String sendGet(final String url) { StringBuilder result = new StringBuilder(); HttpURLConnection urlConnection = null; try { String apiUrl = getAbsoluteUrl(url); // concatenate uri with base url eg: … Read more

Service-Based Authentication Using Tokens

I’m having a tough time trying to find clear and concise examples of how one would implement a service-based authentication scheme using tokens. As far as I can tell, the basic steps are as follows: Client requests username/password from user Client passes username/password to identity provider Provider checks username/password and sends back a token if … Read more

REST service using Spring Security and Firebase Authentication

Is there a simple way to integrate Firebase Authentication with Spring Security (for a REST service)? From what I’ve read, I’ll probably need to use a JWT token (obtained via Firebase), use that to authenticate the Spring service, and finally verify the token within the service via Firebase. But I can’t find any (simple) documentation … Read more