我使用wildfly 9.0.1.Final無法找到類型的上下文數據:java.ws.rs.container.ContainerRequest(Wildfly誤差)
我部署具有這樣定義端點的REST應用:
@GET
@Path("/view/products")
@Produces(MediaType.APPLICATION_JSON)
@CORSEnabled
@Protected
public String getConfiguredProducts(
@Context ContainerRequestContext request) {
if (request != null) {
Integer companyId = (Integer) request.getProperty("company");
if (companyId != null) {
//do stuff
}
}
// ... more staff
}
當應用程序運行時,上下文被注入,即'request'非空。
當我嘗試雖然找回我回去錯誤的性質:
executing GET /complaints/view/products:
org.jboss.resteasy.spi.LoggableFailure: Unable to find contextual data
of type: javax.ws.rs.container.ContainerRequestContext
請注意,該應用程序,而不在GlassFish /球衣問題上運行,並出現了問題,當我試圖將它移動到wildfly /高枕無憂。
任何想法?