generator-jhipster: Request method 'POST' not supported

When I generated my first entity with a one-to-many relationship, when running the app, I got the message “Request method ‘POST’ not supported” everytime I want to save a new record.

Here a paste some log messages:

[DEBUG] org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor - Written [{timestamp=Sat Oct 03 15:13:47 CDT 2015, status=405, error=Method Not Allowed, exception=org.springframework.web.HttpRequestMethodNotSupportedException, message=Request method 'POST' not supported, path=/api/items}] as "application/json;charset=UTF-8" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@635d2bbc]
[DEBUG] org.springframework.web.servlet.DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
[DEBUG] org.springframework.web.servlet.DispatcherServlet - Successfully completed request

[locations=[ServletContext resource [/], class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@6c5c9e23]]]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 25 (11 by maintainers)

Most upvoted comments

I experienced the same issue but was solved by just relaunching the project. The tables were not created in the DB and therefore the error. Relaunching made liquibase to update the tables and worked fine. I guess this is the normal behaviour for liquibase (?)

Had the same problem. Was running from inside Idea with gradle task: bootRun. Problem went away when relaunched bootRun

I just had the same problem and when I added a Spring Security Annotation to my controller everything was fine.

@Secured(AuthoritiesConstants.USER)

Maybe the error message is a bit misleading…