Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8148558

HttpURLConnection: HTTP method DELETE doesn't support output

XMLWordPrintable

    • x86
    • os_x

      FULL PRODUCT VERSION :
      java version "1.8.0_60"
      Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
      Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      OS Verion: 10.10.5

      A DESCRIPTION OF THE PROBLEM :
      Connected to bug: JDK-7157360

      I am still seeing this error with the latest java version in eclipse.

      I am making a delete call with a request entity..

      Step 1:
      webResource.uri(new URI("developer_authnauth_token")).header("some token")
      .header("key", "value").header("key", "value").header("key", "value").header("Environment", "staging").header("Content-Type", MediaType.APPLICATION_JSON);
              
              
      Step 2: webResource.delete(ClientResponse.class, "Input");

      Below is the exception i see everytime:

      com.sun.jersey.api.client.ClientHandlerException: java.net.ProtocolException: HTTP method DELETE doesn't support output
      at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:155)
      at com.sun.jersey.api.client.Client.handle(Client.java:652)
      at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
      at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
      at com.sun.jersey.api.client.WebResource$Builder.delete(WebResource.java:601)
      at com.ebay.maui.component.edpsvc.util.ServiceExecutor.executeRestCall(ServiceExecutor.java:234)
      at com.ebay.maui.edpsvc.test.AuthNAuthTokenSvcTestPlan.testRevokeToken(AuthNAuthTokenSvcTestPlan.java:133)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
      at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
      at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
      at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
      at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
      Caused by: java.net.ProtocolException: HTTP method DELETE doesn't support output
      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1081)
      at com.sun.jersey.client.urlconnection.URLConnectionClientHandler$1$1.getOutputStream(URLConnectionClientHandler.java:238)
      at com.sun.jersey.api.client.CommittingOutputStream.commitStream(CommittingOutputStream.java:117)
      at com.sun.jersey.api.client.CommittingOutputStream.write(CommittingOutputStream.java:89)
      at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
      at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
      at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)
      at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
      at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
      at java.io.BufferedWriter.flush(BufferedWriter.java:254)
      at com.sun.jersey.core.util.ReaderWriter.writeToAsString(ReaderWriter.java:191)
      at com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider.writeToAsString(AbstractMessageReaderWriterProvider.java:128)
      at com.sun.jersey.core.impl.provider.entity.StringProvider.writeTo(StringProvider.java:88)
      at com.sun.jersey.core.impl.provider.entity.StringProvider.writeTo(StringProvider.java:58)
      at com.sun.jersey.api.client.RequestWriter.writeRequestEntity(RequestWriter.java:300)
      at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:217)
      at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:153)



      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_60"
      Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
      Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      com.sun.jersey.api.client.ClientHandlerException: java.net.ProtocolException: HTTP method DELETE doesn't support output
      at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:155)
      at com.sun.jersey.api.client.Client.handle(Client.java:652)
      at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
      at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
      at com.sun.jersey.api.client.WebResource$Builder.delete(WebResource.java:601)
      at com.ebay.maui.component.edpsvc.util.ServiceExecutor.executeRestCall(ServiceExecutor.java:234)
      at com.ebay.maui.edpsvc.test.AuthNAuthTokenSvcTestPlan.testRevokeToken(AuthNAuthTokenSvcTestPlan.java:133)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
      at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
      at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
      at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
      at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
      Caused by: java.net.ProtocolException: HTTP method DELETE doesn't support output
      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1081)
      at com.sun.jersey.client.urlconnection.URLConnectionClientHandler$1$1.getOutputStream(URLConnectionClientHandler.java:238)
      at com.sun.jersey.api.client.CommittingOutputStream.commitStream(CommittingOutputStream.java:117)
      at com.sun.jersey.api.client.CommittingOutputStream.write(CommittingOutputStream.java:89)
      at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
      at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
      at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)
      at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
      at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
      at java.io.BufferedWriter.flush(BufferedWriter.java:254)
      at com.sun.jersey.core.util.ReaderWriter.writeToAsString(ReaderWriter.java:191)
      at com.sun.jersey.core.provider.AbstractMessageReaderWriterProvider.writeToAsString(AbstractMessageReaderWriterProvider.java:128)
      at com.sun.jersey.core.impl.provider.entity.StringProvider.writeTo(StringProvider.java:88)
      at com.sun.jersey.core.impl.provider.entity.StringProvider.writeTo(StringProvider.java:58)
      at com.sun.jersey.api.client.RequestWriter.writeRequestEntity(RequestWriter.java:300)
      at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:217)
      at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:153)

      REPRODUCIBILITY :
      This bug can be reproduced always.

            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: