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

前端 未结 15 862
孤街浪徒
孤街浪徒 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:21

    I managed cause the same error, and this was due to two situations 1) The definition of paths within the resources ws MUST NOT start from a "/xyz" just be "xyz" to ResourceConfig @ApplicationPath ("/")

    2) also occurs due to the dependence of any API (jar) in the .war project or tomcat/lib

    3) It also occurs when there is ambiguity in the resource path (duplicates same name) is presented in the following log: "WARNING: A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by @Consumes and @Produces annotations at Java methods public javax.ws.rs.core.Response"

    Netbeans 8.1, Apache Tomcat 8.0.12, JAX-RS 2.0 (jersey 2.12)

提交回复
热议问题