cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "subramaniam.venkat" <subramaniam.ven...@gmail.com>
Subject Getting java.io.EOFException: Response contained no data when invoking a Rest API from Weblogic using CXF
Date Mon, 21 Nov 2016 14:26:54 GMT
When i am invoking a rest API using JAXRS i am receiving an EOFException. 

When i run the same as an standalone Java Application. It is working fine
and i am getting the response. But the same when i execute in Weblogic 10.3
I am receiving the EOFException. 

Below the Code snippet. 

JAXRSClientFactoryBean jaxRSClientFactoryBean = new
JAXRSClientFactoryBean(); 
          jaxRSClientFactoryBean.setAddress(
"https://api.testing.net:443/api/v1/Account?AccountId=9"); 
          System.out.println(" URL: " + 
jaxRSClientFactoryBean.getAddress()); 
          WebClient restClient =  jaxRSClientFactoryBean.createWebClient(); 
          restClient.accept(MediaType.APPLICATION_JSON); 
          restClient.type(MediaType.APPLICATION_JSON_TYPE); 
          restClient.header("Authorization", "basic xxxxxxx"); 
          HTTPClientPolicy httpClientPolicy = new  HTTPClientPolicy(); 
          httpClientPolicy.setConnectionTimeout(30000); 
          httpClientPolicy.setReceiveTimeout(30000); 
          httpClientPolicy.setConnection(ConnectionType.CLOSE); 
          httpClientPolicy.setAllowChunking(false); 
          http.setClient(httpClientPolicy); 
          String responseStr =  restClient.get(String.class); 
          System.out.println("Response Received"+responseStr); 


When i Execute the same in Weblogic. I am getting the below Exception. 

Caused by: java.io.EOFException: EOFException invoking
https://api.testing.net:443/api/v1/Account?AccountId=9: Response contained
no data 
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method) 
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

        at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1336)

        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1320)

        at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) 
        at
org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:622) 
        at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)

        ... 147 more 
        Caused by: java.io.EOFException: Response contained no data 
        at weblogic.net.http.MessageHeader.isHTTP(MessageHeader.java:227) 
        at
weblogic.net.http.MessageHeader.parseHeader(MessageHeader.java:148) 
        at weblogic.net.http.HttpClient.parseHTTP(HttpClient.java:468) 
        at
weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:377) 
        at
weblogic.net.http.SOAPHttpsURLConnection.getInputStream(SOAPHttpsURLConnection.java:37) 
        at
weblogic.net.http.HttpURLConnection.getResponseCode(HttpURLConnection.java:965) 
        at
org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.getResponseCode(URLConnectionHTTPConduit.java:248)

        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1515)

        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1488)

        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1307)




Any pointers. 

Thanks.



--
View this message in context: http://cxf.547215.n5.nabble.com/Getting-java-io-EOFException-Response-contained-no-data-when-invoking-a-Rest-API-from-Weblogic-usingF-tp5775063.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Mime
View raw message