0

Web サービスのデプロイで発生している問題に少し行き詰まっています。私は一見すべてを試しました(明らかにそれは真実ではありませんが)。

これらは私のジャージの依存関係です:

    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-servlet</artifactId>
        <version>1.17</version>
    </dependency>
    <dependency>
        <groupId>com.sun.jersey.contribs</groupId>
        <artifactId>jersey-multipart</artifactId>
        <version>1.17</version>
    </dependency>

    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-bundle</artifactId>
        <version>1.17</version>
    </dependency>

    <dependency>
        <groupId>org.jvnet</groupId>
        <artifactId>mimepull</artifactId>
        <version>1.6</version>
    </dependency>

これが私がサービスの1つに持っているコードです:

@POST
@Path("/")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces("text/plain")
public String uploadFile(@FormDataParam("uploadID") String uploadID,
        @FormDataParam("file") InputStream uploadedFile,
        @FormDataParam("file") FormDataContentDisposition fileDetail) {


    UploadServiceHandler handler = uploadHandlers.get(uploadID);

    if (!isValidParameters(uploadID, uploadedFile, fileDetail, handler)
            || uploadID.length() == 0) {
        log.info(uploadID + " received upload ERROR Invalid Request");
        return new MessagesBean(ResponseTypes.ERROR, 1, "Invalid Request")
                .toJSONString();
    }

    handler.init(uploadedFile, UPLOAD_PATH);
    uploadHandlers.put(uploadID, handler);
    log.info(uploadID + " started file upload");
    handler.handleRequest();
    String jsonString = handler.bean().toJSONString();

    DaemonCleaner.addPath(handler.getDeletePath());
    uploadHandlers.remove(handler.getUploadID());
    handler.destroy();

    return jsonString;
}

これは、Jersey からの結果のスタック トレースです。

SEVERE: The following errors and warnings have been detected with resource and/or provider classes:
  WARNING: A sub-resource method, public java.lang.String org.isatools.resources.UpdateServices.update(java.lang.String), with URI template, "/", is treated as a resource method
  WARNING: A sub-resource method, public java.lang.String org.isatools.resources.UploadServices.uploadFile(java.lang.String,java.io.InputStream,com.sun.jersey.core.header.FormDataContentDisposition), with URI template, "/", is treated as a resource method
  SEVERE: Missing dependency for method public java.lang.String org.isatools.resources.UploadServices.postInit(java.lang.String,long) at parameter at index 0
  SEVERE: Missing dependency for method public java.lang.String org.isatools.resources.UploadServices.postInit(java.lang.String,long) at parameter at index 1
  SEVERE: Method, public java.lang.String org.isatools.resources.UploadServices.postInit(java.lang.String,long), annotated with POST of resource, class org.isatools.resources.UploadServices, is not recognized as valid resource method.
  SEVERE: Missing dependency for method public java.lang.String org.isatools.resources.UploadServices.uploadFile(java.lang.String,java.io.InputStream,com.sun.jersey.core.header.FormDataContentDisposition) at parameter at index 0
  SEVERE: Missing dependency for method public java.lang.String org.isatools.resources.UploadServices.uploadFile(java.lang.String,java.io.InputStream,com.sun.jersey.core.header.FormDataContentDisposition) at parameter at index 1
  SEVERE: Missing dependency for method public java.lang.String org.isatools.resources.UploadServices.uploadFile(java.lang.String,java.io.InputStream,com.sun.jersey.core.header.FormDataContentDisposition) at parameter at index 2
  SEVERE: Method, public java.lang.String org.isatools.resources.UploadServices.uploadFile(java.lang.String,java.io.InputStream,com.sun.jersey.core.header.FormDataContentDisposition), annotated with POST of resource, class org.isatools.resources.UploadServices, is not recognized as valid resource method.

ご協力いただきありがとうございます。

4

1 に答える 1

1

これは、pom を削減した依存関係を持つ別のパッケージからの隠れた競合する依存関係が原因でした (そのため、IDE で実際にインポートされた依存関係を確認できません)。

このエラーは少なくとも消えました。今、私は対立と戦い続けています!

于 2013-07-27T14:04:18.587 に答える