简体   繁体   English

在 Glassfish 服务器中使用 jersey 框架上传文件

[英]file upload with jersey framework in Glassfish server

I try to learning file uploading in jersey.我尝试在球衣中学习文件上传。 I wrote simple code to make sure it is work .when I run project in Glassfish server it give me this error .我编写了简单的代码以确保它正常工作。当我在 Glassfish 服务器中运行项目时,它给了我这个错误。 How could I solve it ?我怎么能解决呢?

GlassFish Server 4.1, deploy, null, false C:\\Users\\Documents\\NetBeansProjects\\MyProject\\nbproject\\build-impl.xml:1057: The module has not been deployed. GlassFish Server 4.1,deploy,null,false C:\\Users\\Documents\\NetBeansProjects\\MyProject\\nbproject\\build-impl.xml:1057:模块尚未部署。 See the server log for details.有关详细信息,请参阅服务器日志。 BUILD FAILED (total time: 1 second)构建失败(总时间:1 秒)

my code is我的代码是

 @POST
 @Path("/upload")
 @Consumes(MediaType.MULTIPART_FORM_DATA)
 public String uploadFile(
 @FormDataParam("file") InputStream uploadedInputStream,
 @FormDataParam("file") FormDataContentDisposition fileDetail) {
 return "";
 }

I think this error not belongs to glassfish server.我认为这个错误不属于 glassfish 服务器。 Restart netbeans and clean and build your project because netbeans also write self generated code corresponding to webservices.重新启动 netbeans 并清理和构建您的项目,因为 netbeans 还编写与 web 服务相对应的自生成代码。 I recommended to use eclipse j2ee IDE.我推荐使用eclipse j2ee IDE。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM