因为缺失POST GET注解而导致Failed processing arguments of org.jboss.resteasy.spi.metadata.ResourceLocator
2017-05-31 15:07
716 查看
面向服务的架构现在如火如荼,国内常用的当属阿里巴巴开源的dubbo,但我觉得后起之秀的spring cloud很可能弯道超车。闲话说了一些,下面入主题,出问题rest服务接口
@Path("queryList")
//@POST---漏掉@POST注解就会出错
@Override
下面来分析下POST注解:
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@HttpMethod(HttpMethod.POST)
@Documented
public @interface POST {
}
这个里面又涉及到一个主要的注解HttpMethod:
/**
* Associates the name of a HTTP method with an annotation. A Java method annotated
* with a runtime annotation that is itself annotated with this annotation will
* be used to handle HTTP requests of the indicated HTTP method. It is an error
* for a method to be annotated with more than one annotation that is annotated
* with {@code HttpMethod}.
*
* @author Paul Sandoz
* @author Marc Hadley
* @see GET
* @see POST
* @see PUT
* @see DELETE
* @see HEAD
* @since 1.0
*/
@Target({ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface HttpMethod
该接口doc说明概括下来就是:
HttpMethod(或者扩展注解接口)注解的方法会被用来处理相应HTTP请求方法(POST/GET/PUT等)请求,如果漏掉这个注解,那么相应的方法就没有了这个能力!!
@Path("queryList")
//@POST---漏掉@POST注解就会出错
@Override
下面来分析下POST注解:
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@HttpMethod(HttpMethod.POST)
@Documented
public @interface POST {
}
这个里面又涉及到一个主要的注解HttpMethod:
/**
* Associates the name of a HTTP method with an annotation. A Java method annotated
* with a runtime annotation that is itself annotated with this annotation will
* be used to handle HTTP requests of the indicated HTTP method. It is an error
* for a method to be annotated with more than one annotation that is annotated
* with {@code HttpMethod}.
*
* @author Paul Sandoz
* @author Marc Hadley
* @see GET
* @see POST
* @see PUT
* @see DELETE
* @see HEAD
* @since 1.0
*/
@Target({ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface HttpMethod
该接口doc说明概括下来就是:
HttpMethod(或者扩展注解接口)注解的方法会被用来处理相应HTTP请求方法(POST/GET/PUT等)请求,如果漏掉这个注解,那么相应的方法就没有了这个能力!!
相关文章推荐
- Bad arguments passed to org.jboss.resteasy.spi.metadata.ResourceMethod
- Bad arguments passed to org.jboss.resteasy.spi.metadata
- org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.jboss.resteasy.plug
- java.lang.NoSuchMethodError: org.jboss.resteasy.spi.ResteasyUriInfo.setRemoteAddress(Ljava/net/InetS
- servlet: org.apache.tomcat.util.http.fileupload.FileUploadException: Processing of multipart/form-data request failed
- Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: Multiple representations of the same entity解决方法
- Error creating bean with name 'userService': Injection of resource methods failed; nested exception is org.springframework.beans
- 上传文件出错:org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly
- Unable to parse request org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. null
- org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed解决
- Spring MVC集成thymeleaf时提示:defined in ServletContext resource [/WEB-INF/SrpingMVCTest-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException
- RestEasy 用户指南----第4章.使用@Path @GET @POST 等
- RESTEasy之间交互之Post和Get
- Request processing failed; nested exception is org.springframework.dao.TransientDataAccessResourceEx
- Error creating bean with name 'userService': Injection of resource methods failed; nested exception is org.springframework.beans
- 上传文件出错:org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly
- RestEasy 用户指南----第4章.使用@Path @GET @POST 等
- RestEasy 用户指南----第4章.使用@Path @GET @POST 等
- Why we use HTTP POST instead of HTTP GET
- An error occurred during local report processing.Failed to load expression host assembly. Details: Request for the permission of