小编Dre*_*w13的帖子

DateTime 上的参数类型不正确

Intellij 告诉我这updateTime是不正确的参数类型。我不熟悉这个错误和@EnumDateFormat.

    @DELETE
    @Path("groups/{groupId}/samples/{testYear}")
    @Produces(MediaType.APPLICATION_JSON)
    @RolesAllowed({Profile.MP_USER_ROLE})
    public Response deleteGroupSamples (@PathParam("groupId") Long groupId, @PathParam("testYear") Long testYear, @QueryParam("updateTime") @EnumDateFormat( FormatEnum.WITH_HHMMSS ) DateTime updateTime, TreatmentGroupTest sample) throws ValidationException{
        manager.deleteGroupSample( this.getUser(), sample.getTestSampleId(), updateTime );
        ResponseBuilder builder=null;
        builder = Response.ok(  );
        return builder.build();
    }
Run Code Online (Sandbox Code Playgroud)

该错误还表明:

检查参数@PathParam、@QueryParam 等的类型。带注释的参数、字段或属性的类型必须是

  1. 是原始类型

  2. 有一个接受单个字符串参数的构造函数

  3. 有一个名为 valueOf 或 formString 的静态方法,它接受单个 String 参数(例如,参见 Integer.valueOf(String))

  4. 拥有 ParamConverterProvider JAX-RS 扩展 SPI 的注册实现,该实现返回能够进行该类型“表单字符串”转换的 ParamConverter 实例

  5. 是 List、Set 或 SortedSet,其中 T 满足上述 2、3 或 4。结果集合是只读的

java datetime jax-rs

2
推荐指数
1
解决办法
1711
查看次数

Quartz Scheduler 初始化失败

得到这些错误:

2018-01-22 18:00:59,797 [ServerService Thread Pool -- 79] ERROR org.quartz.ee.servlet.QuartzInitializerListener - Quartz Scheduler failed to initialize: org.quartz.SchedulerException: SchedulerPlugin class 'org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin' could not be instantiated. [See nested exception: java.lang.ClassNotFoundException: Unable to load class org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin by any known loaders.]
2018-01-22 18:00:59,797 [ServerService Thread Pool -- 79] ERROR stderr - org.quartz.SchedulerException: SchedulerPlugin class 'org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin' could not be instantiated. [See nested exception: java.lang.ClassNotFoundException: Unable to load class org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin by any known loaders.]
2018-01-22 18:00:59,805 [ServerService Thread Pool -- 79] ERROR stderr - Caused by: …
Run Code Online (Sandbox Code Playgroud)

quartz-scheduler

2
推荐指数
1
解决办法
2711
查看次数

在哪里将 HttpClient 的 responseType 设置为 http GET 角度

我有一个向我的后端发出 http 调用的服务:

exportSubs(param: Param): Observable<Sub[]> {
    return this.http.get<Sub[]>(
      `${environment.apiBaseUrl}/blah`,
      {headers: this.httpUtil.getReqHeaders})
      .catch(error => this.httpUtil.handleError(error));
  }
Run Code Online (Sandbox Code Playgroud)

我在哪里设置 responseType?

angular

1
推荐指数
1
解决办法
7876
查看次数

CellStyle.setAlignment(HorizontalAlignment.CENTER) error

CellStyle stringStyle = workbook.createCellStyle();
stringStyle.setAlignment(HorizontalAlignment.CENTER);
Run Code Online (Sandbox Code Playgroud)

this code produces error:

method setAlignment in interface CellStyle cannot be applied to given types;

required: short

found: HorizontalAlignment

reason: actual argument HorizontalAlignment cannot be converted to short by method invocation conversion

so I change the code to use a short:

CellStyle stringStyle = workbook.createCellStyle();
stringStyle.setAlignment((short)1);
Run Code Online (Sandbox Code Playgroud)

And my IDE complains saying:

setAlignment (org.apache.poi.ss.usermodel.HorizontalAlignment) in CellStyle cannot be applied to (short)

So it complains that it wants a short when I give it a HorizontalAlignment and …

java apache-poi

0
推荐指数
1
解决办法
2989
查看次数

标签 统计

java ×2

angular ×1

apache-poi ×1

datetime ×1

jax-rs ×1

quartz-scheduler ×1