Why would “java.lang.IllegalStateException: The resource configuration is not modifiable in this context.” appear deploying Jersey app?

前端 未结 15 894
孤街浪徒
孤街浪徒 2020-11-30 15:06

I have created an app implementing REST services locally using:

Eclipse Indigo Jersey 2.4 Tomcat 7.0.47

When running locally using Eclipse, the services work

15条回答
  •  一生所求
    2020-11-30 15:42

    The above exception might be a consequence exception when Jersey cannot inject some user type into e.g. @QueryParam/@PathParam. E.g. you haven't registered your ParamConverterProvider. Look above in the logs, for the first exception trace.

    I resolved my case with:

    @Component public static class JerseyConfig extends ResourceConfig { public JerseyConfig() { this.register(LocalDateParamProvider.class); } }

    (I use Spring.) When I inserted the above register() call, the exception has gone.

提交回复
热议问题