gpt4 book ai didi

java - MULTIPART_FORM_DATA : No injection source found for a parameter of type Response

转载 作者:搜寻专家 更新时间:2023-11-01 02:38:46 24 4
gpt4 key购买 nike

<分区>

我正在尝试使用 multipart/form-data 为 JAX-RS 上传文件。当我尝试启动服务器时,出现此错误:

[[FATAL] No injection source found for a parameter of type public javax.ws.rs.core.Response
com.pododdle.resources.UploadResource.uploadAudio(int,int,java.io.InputStream,org.glassfish.jersey.media.multipart.FormDataContentDisposition)
at index 2.;source='ResourceMethod{httpMethod=POST, consumedTypes=[multipart/form-data], producedTypes=[text/html], suspended=false, suspendTimeout=0, suspendTimeoutUnit=MILLISECONDS, invocable=Invocable{handler=ClassBasedMethodHandler{handlerClass=class
com.pododdle.resources.UploadResource, handlerConstructors=[org.glassfish.jersey.server.model.HandlerConstructor@29d4c93f]}, definitionMethod=public javax.ws.rs.core.Response
com.pododdle.resources.UploadResource.uploadAudio(int,int,java.io.InputStream,org.glassfish.jersey.media.multipart.FormDataContentDisposition), parameters=[Parameter [type=int, source=auction_id, defaultValue=null], Parameter [type=int, source=category_id, defaultValue=null], Parameter [type=class java.io.InputStream, source=file, defaultValue=null], Parameter [type=class org.glassfish.jersey.media.multipart.FormDataContentDisposition, source=file, defaultValue=null]], responseType=class javax.ws.rs.core.Response}, nameBindings=[]}']

我的 pom.xml 看起来像这样:

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>${jersey.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
</dependency>

<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>${jersey.version}</version>
</dependency>

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

</dependencies>
<properties>
<jersey.version>2.22.1</jersey.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

与我从这里获得的 2.22.1 版 Jersey 一起使用的 mimepull 版本:https://www.versioneye.com/java/org.glassfish.jersey.media:jersey-media-multipart/2.22.1

我是否遗漏了什么,或者没有正确配置?我是这方面的新手,所以对我放轻松...:)

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com