泽西岛模型验证例外情况 - 未找到注入源
我遇到了一个奇怪的问题,我绝对不明白,泽西岛2.6。
我无法解释为什么,但是其中一个查询参数使球衣抛出一个 ModelValidationException
@ApiOperation("Save")
@PUT
public Response save(
@HeaderParam("token") final String token,
@QueryParam("someValue") final SomeValueDTO someValue,
@QueryParam("anotherParam") final int anotherParam) throws TechnicalException {
return Response.ok().build();
}
查询参数“someValue”使球衣投掷:
org.glassfish.jersey.server.model.ModelValidationException: Validation of the application resource model has failed during application initialization.|[[FATAL] No injection source found for a parameter of type public javax.ws.rs.core.Response ch.rodano.studies.api.resources.PagesResource.save(java.lang.String,ch.rodano.studies.api.dto.JSONValueDTO,int) throws ch.rodano.studies.exceptions.RightException,ch.rodano.studies.configuration.exceptions.NoNodeException at index 1.; source='ResourceMethod{httpMethod=PUT, consumedTypes=[], producedTypes=[application/json], suspended=false, suspendTimeout=0, suspendTimeoutUnit=MILLISECONDS, invocable=Invocable{handler=ClassBasedMethodHandler{handlerClass=class ch.rodano.studies.api.resources.PagesResource, handlerConstructors=[org.glassfish.jersey.server.model.HandlerConstructor@41ed3918]}, definitionMethod=public javax.ws.rs.core.Response ch.rodano.studies.api.resources.PagesResource.save(java.lang.String,ch.rodano.studies.api.dto.JSONValueDTO,int) throws ch.rodano.studies.exceptions.RightException,ch.rodano.studies.configuration.exceptions.NoNodeException, parameters=[Parameter [type=class java.lang.String, source=token, defaultValue=null], Parameter [type=class ch.rodano.studies.api.dto.JSONValueDTO, source=valuesASD, defaultValue=null], Parameter [type=int, source=visitPk, defaultValue=null]], responseType=class javax.ws.rs.core.Response}, nameBindings=[]}']
如果我使用String而不是SomeValueDTO,一切都没关系。SomeValueDTO是一个非常经典的POJO,带有一个空构造函数和getters/setters。
如果有人有一个伊迪亚!