我最近将我们的应用程序升级到Weblogic 12c,现在我遇到了JAX-RS服务的问题。该服务如下所示:
public DocumentMetadataResponseBean postDocument(@Context final HttpServletRequest request,
@FormDataParam("doc") final InputStream inputStream,
@FormDataParam("doc") final FormDataBodyPart formDataBodyPart,
@PathParam("employeeOid") @ApiParam("The person uploading the document") final Long employeeOid,
@QueryParam("person") @ApiParam("The person which the document is associated with") final Long personOid,
@QueryParam("name") @ApiParam("The name of the document") final String documentName,
@QueryParam("personDocId") @ApiParam(value = "The documentOid for the document to be used. Only if existing document is used for a request",required=false)final Long personDocumentOid,
@QueryParam("category") @ApiParam("The category associated with the document (i.e. Birth Certificate)") final String documentCategory,
@QueryParam("documentRequestId") @ApiParam(value = "the documentRequestOid associated with the document request",required=false) final Long documentRequestOid,
@QueryParam("desc") @ApiParam(value = "A brief description of the document", required=false) final String description,
@QueryParam("version") @ApiParam("The version of the service") final Integer version){
启动应用时出现的错误是:[[FATAL] No injection source found for a parameter of type public com.test.DocumentMetadataResponseBean com.test.DocumentJaxRsService.postDocument(java.io.InputStream,org.glassfish.jersey.media.multipart.FormDataBodyPart,java.lang.Long,java.lang.Long,java.lang.String,java.lang.Long,java.lang.String,java.lang.Long,java.lang.String,java.lang.Integer) at index 0.; source='ResourceMethod{httpMethod=POST, consumedTypes=[multipart/form-data], producedTypes=[application/json, application/xml], suspended=false, suspendTimeout=0, suspendTimeoutUnit=MILLISECONDS, invocable=Invocable{handler=ClassBasedMethodHandler{handlerClass=class com.test.DocumentJaxRsService, handlerConstructors=[org.glassfish.jersey.server.model.HandlerConstructor@2e52db74]}, definitionMethod=public com.test.DocumentMetadataResponseBean com.test.DocumentJaxRsService.postDocument(java.io.InputStream,org.glassfish.jersey.media.multipart.FormDataBodyPart,java.lang.Long,java.lang.Long,java.lang.String,java.lang.Long,java.lang.String,java.lang.Long,java.lang.String,java.lang.Integer), parameters=[Parameter [type=class java.io.InputStream, source=doc, defaultValue=null], Parameter [type=class org.glassfish.jersey.media.multipart.FormDataBodyPart, source=doc, defaultValue=null], Parameter [type=class java.lang.Long, source=employeeOid, defaultValue=null], Parameter [type=class java.lang.Long, source=person, defaultValue=null], Parameter [type=class java.lang.String, source=name, defaultValue=null], Parameter [type=class java.lang.Long, source=personDocId, defaultValue=null], Parameter [type=class java.lang.String, source=category, defaultValue=null], Parameter [type=class java.lang.Long, source=documentRequestId, defaultValue=null], Parameter [type=class java.lang.String, source=desc, defaultValue=null], Parameter [type=class java.lang.Integer, source=version, defaultValue=null]], responseType=class com.test.DocumentMetadataResponseBean}, nameBindings=[]}']
我正在使用javax.ws.rs-api 2.0.1和Jersey 2.25。我确实在Jersey servlet中注册了MultiPartFeature作为init参数。如果我切换回weblogic 11g,一切正常,所以我确定它是某种类路径问题,但我已经尝试了所有可能的版本组合,我可以想到这些库,似乎没有任何工作。