我試圖上傳文件,但使用@FormDataParam
不允許應用程序進行部署。有興趣的代碼如下:@FormDataParam引發SEVERE:缺少相關性並且不允許部署
@POST
@Path("sync")
public String callServletSyncPost (
@PathParam("tapschema") String tapschema,
@FormParam("REQUEST") String request,
@FormParam("LANG") String lang,
@FormParam("QUERY") String query,
@FormParam("UPLOAD") String upload,
//@FormDataParam("file") File fileUpload
@FormDataParam("file") InputStream fileUpload,
@FormDataParam("file") FormDataContentDisposition fileDetail
)
throws Exception {
我已經添加到項目中下列庫:
ASM-3.1.jar
傑克遜核心ASL-1.1.1的.jar
球衣,客戶1.2.jar
球衣核-1.2.jar
Jersey的JSON-1.2.jar
球衣 - 服務器 - 1.2.jar
拋放-1.1.jar
JSR311-API -1.1.1.jar
mimepull.jar
球衣,multipart.jar
我也嘗試添加jersey-bundle-1.2.jar
庫,但應用程序不部署。
在GlassFish 3.1日誌頁面存在以下日誌:
The following errors and warnings have been detected with resource and/or provider classes: SEVERE: Missing dependency for method public java.lang.String it.inaf.oats.ia2.tap.implementation.TapRestImpl.callServletSyncPost(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.io.File) throws java.lang.Exception at parameter at index 5 SEVERE: Missing dependency for method public java.lang.String it.inaf.oats.ia2.tap.implementation.TapRestImpl.callServletSyncPost(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.io.File) throws java.lang.Exception at parameter at index 5 SEVERE: Method, public java.lang.String it.inaf.oats.ia2.tap.implementation.TapRestImpl.callServletSyncPost(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.io.File) throws java.lang.Exception, annotated with POST of resource, class it.inaf.oats.ia2.tap.implementation.TapRestImpl, is not recognized as valid resource method.
有人能告訴我,爲什麼應用程序不部署,如何解決這個問題? 在此先感謝
你有沒有解決這個問題,彼得? – sager