title: io.dropwizard.jersey.errors.LoggingExceptionMapper: Error handling a request: 5a81495aefe8fa44 ! java.lang.NullPointerException: null
body: <p>i am trying to create a rest Api in dropwizard which will consume MULTIPART FORM_DATA and will do something with it return a Response but if user passes not multipart file than the system is return response</p>
  
  <pre><code>{
  "code": 500,
  "message": "There was an error processing your request. It has been logged (ID dd0ffe2edbe69923)."`}`
  </code></pre>
  
  <p>intstead of that i want my own response there . this is response that client is getting</p>
  
  <pre><code>@POST
  
  @Path("/upload")
  @CacheControl(maxAge = 1, maxAgeUnit = TimeUnit.DAYS)
  @Consumes(MediaType.MULTIPART_FORM_DATA)
  @Produces({"application/json", "application/xml", 
              "application/OCTET_STREAM", "application/x-protobuf", 
              "application/PLAIN.TEXT"})
  public Response start(@FormDataParam("file") InputStream inputStream,
                        @FormDataParam("file") FormDataContentDisposition fileDetail
                        )throws NullPointerException,Exception{
  
  
  
  
      return Response.ok("anything").build( );
  
  }
  </code></pre>
  
  <p>and the Request is</p>
  
  <pre><code>    curl -X POST \
    http://localhost:3013/not \
    -H 'cache-control: no-cache' \
    -H 'postman-token: 8214d505-55a4-c13d-80df-896582a6cff0'
  </code></pre>
  
  <p>and this is error shown at server</p>
  
  <pre><code>ERROR [2017-07-12 16:38:02,543] io.dropwizard.jersey.errors.LoggingExceptionMapper: Error handling a request: dd0ffe2edbe69923
  ! java.lang.NullPointerException: null
  ! at org.glassfish.jersey.media.multipart.internal.FormDataParamValueFactoryProvider$FormDataParamValueFactory.provide(FormDataParamValueFactoryProvider.java:282)
  ! at org.glassfish.jersey.server.spi.internal.ParamValueFactoryWithSource.provide(ParamValueFactoryWithSource.java:71)
  ! at org.glassfish.jersey.server.spi.internal.ParameterValueHelper.getParameterValues(ParameterValueHelper.java:90)
  ! at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$AbstractMethodParamInvoker.getParamValues(JavaResourceMethodDispatcherProvider.java:127)
  ! at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
  ! at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
  ! at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
  ! at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
  ! at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
  ! at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
  ! at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
  ! at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
  ! at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
  ! at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
  ! at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
  ! at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
  ! at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
  ! at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
  ! at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473)
  ! at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
  ! at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
  ! at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
  ! at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
  ! at io.dropwizard.jetty.NonblockingServletHolder.handle(NonblockingServletHolder.java:49)
  ! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634)
  ! at io.dropwizard.servlets.ThreadNameFilter.doFilter(ThreadNameFilter.java:34)
  ! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1621)
  ! at io.dropwizard.jersey.filter.AllowedMethodsFilter.handle(AllowedMethodsFilter.java:50)
  ! at io.dropwizard.jersey.filter.AllowedMethodsFilter.doFilter(AllowedMethodsFilter.java:44)
  ! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1621)
  ! at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:541)
  ! at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
  ! at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1239)
  ! at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
  ! at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:481)
  ! at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
  ! at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1141)
  ! at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
  ! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
  ! at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:241)
  ! at io.dropwizard.jetty.RoutingHandler.handle(RoutingHandler.java:51)
  ! at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:494)
  ! at io.dropwizard.jetty.BiDiGzipHandler.handle(BiDiGzipHandler.java:68)
  ! at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:56)
  ! at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:169)
  ! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
  ! at org.eclipse.jetty.server.Server.handle(Server.java:564)
  ! at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
  ! at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
  ! at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
  ! at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
  ! at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
  ! at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
  ! at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
  ! at java.lang.Thread.run(Thread.java:745)
  </code></pre>
  
  <p>and the  Dependencies are</p>
  
  <pre><code>  &lt;dependency&gt;
      &lt;groupId&gt;org.glassfish.jersey.media&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-media-multipart&lt;/artifactId&gt;
       &lt;version&gt;2.17&lt;/version&gt;
      &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
                      &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;junit&lt;/groupId&gt;
                      &lt;artifactId&gt;junit&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
  &lt;/dependency&gt;
  </code></pre>