[Jersey] How to annotate the _at_MultipartConfig togethe with @ApplicationPath?

From: Charlee Chitsuk <>
Date: Wed, 13 Aug 2014 12:59:20 +0700

Hi All,

I've tried to perform the Multipart with Jersey by following the [1]. My
Jersey Application is annotated with "@ApplicationPath" by following the

I also have some customization by using "@Context HttpServletRequest
request" since I've some old utility class that extract the Multipart from
the Servlet and I would like to reuse it.

Sadly the old utility class give me an exception when accessing the
"request.getParts()" as

   Request.getParts is called without multipart configuration.
   Either add a @MultipartConfig to the servlet, or
   a multipart-config element to web.xml

I've tried to annotate my Jersey Application with @MultipartConfig but
there is no luck. I'm not sure I'm doing something wrong or
misunderstanding somewhere or not.

By overview my environment is

OS: MS Widdows 7 - 64 Bits
JDK: 1.7.0_65-b19 - 64Bits
AppServer: Glassfish 4.0.0
Jersey: 2.0 (Since I cannot upgrade the newer Jersey to Glassfish 4.0.0 due
the HK2 issue)

Could you please help to advise further? Thank you very much for your help
in advance.


   Best Regards,
   Charlee Ch.