java.lang.reflect.InvocationTargetException

Java.net JIRA | creation_49221 | 4 years ago
  1. 0

    We have an application that we have run for a while now off of Java 6. It use the jersey client to make call to RESTful services running on, now, a Glassfish 3.1.2 server. This application and the following code work GREAT on Java 6 (either javaw.exe or javaws.exe) but it only runs successfully on Java 7 for javaw.exe - Java Web Start (javaws.exe) throws the following exception, BUT ONLY when the response is "Transfer-Encoding: chunked" (which MOST of our services are coming back as - this was verified though a REST Client Test program) ## Here is the Exception and a Trace leading to the exception... MYDEBUG GET https://server/rest/resources/order/ORDERNUM network: Cache entry not found [url: https://server/rest/resources/order/ORDERNUM, version: null] network: Connecting https://server/rest/resources/order/ORDERNUM with proxy=DIRECT network: Connecting socket://server:443 with proxy=DIRECT network: Connecting https://server/rest/resources/order/ORDERNUM with cookie "__utma=180075764.1583854260.1317325251.1319570927.1321634163.4" preloader: Stop progressCheck thread network: CleanupThread used 3 us network: Downloading resource: https://server/rest/resources/order/ORDERNUM Content-Length: -1 Content-Encoding: null network: Wrote URL https://server/rest/resources/order/ORDERNUM to File %AppData%\LocalLow\Sun\Java\Deployment\cache\6.0\33\7d32c9a1-5e978903-temp network: CleanupThread used 2 us java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.javaws.Launcher.executeApplication(Unknown Source) at com.sun.javaws.Launcher.executeMainClass(Unknown Source) at com.sun.javaws.Launcher.doLaunchApp(Unknown Source) at com.sun.javaws.Launcher.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: com.sun.jersey.api.client.ClientHandlerException: java.io.IOException: stream is closed at com.sun.jersey.api.client.ClientResponse.close(ClientResponse.java:615) at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:570) at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:535) at com.sun.jersey.api.client.WebResource.handle(WebResource.java:696) at com.sun.jersey.api.client.WebResource.access$300(WebResource.java:74) at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:512) at client.AbstractClient.getList(AbstractClient.java:65) at client.OE.FactoryOrderClient.getOpenFactoryOrders(FactoryOrderClient.java:50) at gui.TestClient.main(TestClient.java:42) ... 9 more Caused by: java.io.IOException: stream is closed at sun.net.www.http.ChunkedInputStream.ensureOpen(Unknown Source) at sun.net.www.http.ChunkedInputStream.read(Unknown Source) at java.io.FilterInputStream.read(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(Unknown Source) at com.sun.jersey.api.client.ClientResponse.close(ClientResponse.java:613) ... 17 more ## ## This application uses the following code to get at XML services: //-Create Client for SSL access ClientConfig config = new DefaultClientConfig(); // SSL configuration config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, new HTTPSProperties(getHostnameVerifier(), getSSLContext())); Client client = Client.create(config); //-Get Web Resource WebResource resource = client.resource(BASE_URI).path(path); //process query parms resource = resource.queryParam(e.getKey(), e.getValue()); //Get the RESTful Object try { object = resource.accept(mediaType).get(c); //!!!THE IO EXCEPTION IS THROWN HERE!!! } catch (UniformInterfaceException e) { ClientResponse response = e.getResponse(); //-Process Response as needed... } ## I do not understand why this application runs fine from Java 7 when packaged and run using javaw.exe but fails when run from Java Web Start (javaws.exe) It fails the same way everytime unless the service doesn't "chunk" the Transfer-Encoding. Please let me know if there is anything that could be causing this problem. Thanks! Daryl

    Java.net JIRA | 4 years ago | creation_49221
    java.lang.reflect.InvocationTargetException
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    We have an application that we have run for a while now off of Java 6. It use the jersey client to make call to RESTful services running on, now, a Glassfish 3.1.2 server. This application and the following code work GREAT on Java 6 (either javaw.exe or javaws.exe) but it only runs successfully on Java 7 for javaw.exe - Java Web Start (javaws.exe) throws the following exception, BUT ONLY when the response is "Transfer-Encoding: chunked" (which MOST of our services are coming back as - this was verified though a REST Client Test program) ## Here is the Exception and a Trace leading to the exception... MYDEBUG GET https://server/rest/resources/order/ORDERNUM network: Cache entry not found [url: https://server/rest/resources/order/ORDERNUM, version: null] network: Connecting https://server/rest/resources/order/ORDERNUM with proxy=DIRECT network: Connecting socket://server:443 with proxy=DIRECT network: Connecting https://server/rest/resources/order/ORDERNUM with cookie "__utma=180075764.1583854260.1317325251.1319570927.1321634163.4" preloader: Stop progressCheck thread network: CleanupThread used 3 us network: Downloading resource: https://server/rest/resources/order/ORDERNUM Content-Length: -1 Content-Encoding: null network: Wrote URL https://server/rest/resources/order/ORDERNUM to File %AppData%\LocalLow\Sun\Java\Deployment\cache\6.0\33\7d32c9a1-5e978903-temp network: CleanupThread used 2 us java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.javaws.Launcher.executeApplication(Unknown Source) at com.sun.javaws.Launcher.executeMainClass(Unknown Source) at com.sun.javaws.Launcher.doLaunchApp(Unknown Source) at com.sun.javaws.Launcher.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: com.sun.jersey.api.client.ClientHandlerException: java.io.IOException: stream is closed at com.sun.jersey.api.client.ClientResponse.close(ClientResponse.java:615) at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:570) at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:535) at com.sun.jersey.api.client.WebResource.handle(WebResource.java:696) at com.sun.jersey.api.client.WebResource.access$300(WebResource.java:74) at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:512) at client.AbstractClient.getList(AbstractClient.java:65) at client.OE.FactoryOrderClient.getOpenFactoryOrders(FactoryOrderClient.java:50) at gui.TestClient.main(TestClient.java:42) ... 9 more Caused by: java.io.IOException: stream is closed at sun.net.www.http.ChunkedInputStream.ensureOpen(Unknown Source) at sun.net.www.http.ChunkedInputStream.read(Unknown Source) at java.io.FilterInputStream.read(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(Unknown Source) at com.sun.jersey.api.client.ClientResponse.close(ClientResponse.java:613) ... 17 more ## ## This application uses the following code to get at XML services: //-Create Client for SSL access ClientConfig config = new DefaultClientConfig(); // SSL configuration config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, new HTTPSProperties(getHostnameVerifier(), getSSLContext())); Client client = Client.create(config); //-Get Web Resource WebResource resource = client.resource(BASE_URI).path(path); //process query parms resource = resource.queryParam(e.getKey(), e.getValue()); //Get the RESTful Object try { object = resource.accept(mediaType).get(c); //!!!THE IO EXCEPTION IS THROWN HERE!!! } catch (UniformInterfaceException e) { ClientResponse response = e.getResponse(); //-Process Response as needed... } ## I do not understand why this application runs fine from Java 7 when packaged and run using javaw.exe but fails when run from Java Web Start (javaws.exe) It fails the same way everytime unless the service doesn't "chunk" the Transfer-Encoding. Please let me know if there is anything that could be causing this problem. Thanks! Daryl

    Java.net JIRA | 4 years ago | creation_49221
    java.lang.reflect.InvocationTargetException

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.io.IOException

      stream is closed

      at sun.net.www.http.ChunkedInputStream.ensureOpen()
    2. Java RT
      HttpURLConnection$HttpInputStream.close
      1. sun.net.www.http.ChunkedInputStream.ensureOpen(Unknown Source)
      2. sun.net.www.http.ChunkedInputStream.read(Unknown Source)
      3. java.io.FilterInputStream.read(Unknown Source)
      4. sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
      5. sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
      6. sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
      7. sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(Unknown Source)
      7 frames
    3. jersey-client
      WebResource$Builder.get
      1. com.sun.jersey.api.client.ClientResponse.close(ClientResponse.java:613)
      2. com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:570)
      3. com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:535)
      4. com.sun.jersey.api.client.WebResource.handle(WebResource.java:696)
      5. com.sun.jersey.api.client.WebResource.access$300(WebResource.java:74)
      6. com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:512)
      6 frames
    4. client
      AbstractClient.getList
      1. client.AbstractClient.getList(AbstractClient.java:65)
      1 frame
    5. client.OE
      FactoryOrderClient.getOpenFactoryOrders
      1. client.OE.FactoryOrderClient.getOpenFactoryOrders(FactoryOrderClient.java:50)
      1 frame
    6. gui
      TestClient.main
      1. gui.TestClient.main(TestClient.java:42)
      1 frame
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    8. com.sun.javaws
      Launcher.run
      1. com.sun.javaws.Launcher.executeApplication(Unknown Source)
      2. com.sun.javaws.Launcher.executeMainClass(Unknown Source)
      3. com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
      4. com.sun.javaws.Launcher.run(Unknown Source)
      4 frames
    9. Java RT
      Thread.run
      1. java.lang.Thread.run(Unknown Source)
      1 frame