[
https://issues.apache.org/jira/browse/OPENEJB-843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610015#action_12610015
]
karan singh malhi commented on OPENEJB-843:
-------------------------------------------
Looks like an issue with the Transfer-Encoding:chunked header which is the
default for CXF. Tried to look into OpenEJBHttpServer and HttpRequestImpl
(thats where we handle "chunked"). Could not find the issue because we are
handling "chunked" the way RFC-2616 requires an HttpServer to handle it.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.6.1
Anyways, right now an interim fix for the test could be that we could set the
HttpClientPolicy in CXF to disable "chunked" as follows:-
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Service calcService = Service.create(new
URL("http://127.0.0.1:4204/CalculatorImpl?wsdl"), null);
assertNotNull(calcService);
CalculatorWs calc = calcService.getPort(CalculatorWs.class);
org.apache.cxf.endpoint.Client client =
org.apache.cxf.frontend.ClientProxy.getClient(calc);
// Getting HTTPConduit to set client policy
HTTPConduit http = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
// Disallow chunking -- OTHERWISE THE TEST FAILS
httpClientPolicy.setAllowChunking(false);
http.setClient(httpClientPolicy);
assertEquals(10, calc.sum(4,6));
assertEquals(12, calc.multiply(3,4));
------------------------------------------------------------------------------------------------------------------------------------------------------------------
However, the above is not a permanent fix because then the onus is upon the
client to always make sure chunking is disabled. For large messages, that would
not be a very performant option and chunking would be the optimal solution for
large messages.
I have tried to debug it with whatever time I had, if anybody has time to look
into it and fix it, that would be great!
> CalculatorTest fails
> --------------------
>
> Key: OPENEJB-843
> URL: https://issues.apache.org/jira/browse/OPENEJB-843
> Project: OpenEJB
> Issue Type: Bug
> Components: examples
> Affects Versions: 3.0.1
> Environment: Ubuntu Linux , sun java 1.5
> Reporter: karan singh malhi
> Assignee: karan singh malhi
> Fix For: 3.0.1
>
>
> -------------------------------------------------------------------------------
> Test set: org.superbiz.calculator.CalculatorTest
> -------------------------------------------------------------------------------
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 63.109 sec
> <<< FAILURE!
> testCalculatorViaWsInterface(org.superbiz.calculator.CalculatorTest) Time
> elapsed: 63.073 sec <<< ERROR!
> javax.xml.ws.soap.SOAPFaultException: Could not send Message.
> at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:175)
> at $Proxy17.multiply(Unknown Source)
> at
> org.superbiz.calculator.CalculatorTest.testCalculatorViaWsInterface(CalculatorTest.java:76)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at junit.framework.TestCase.runTest(TestCase.java:164)
> at junit.framework.TestCase.runBare(TestCase.java:130)
> at junit.framework.TestResult$1.protect(TestResult.java:110)
> at junit.framework.TestResult.runProtected(TestResult.java:128)
> at junit.framework.TestResult.run(TestResult.java:113)
> at junit.framework.TestCase.run(TestCase.java:120)
> at junit.framework.TestSuite.runTest(TestSuite.java:228)
> at junit.framework.TestSuite.run(TestSuite.java:223)
> at
> org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:35)
> at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
> at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
> at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338)
> at
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997)
> Caused by: org.apache.cxf.interceptor.Fault: Could not send Message.
> at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:208)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
> ... 25 more
> Caused by: java.net.SocketTimeoutException: Read timed out
> at java.net.SocketInputStream.socketRead0(Native Method)
> at java.net.SocketInputStream.read(SocketInputStream.java:129)
> at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
> at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
> at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
> at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:681)
> at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:626)
> at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:646)
> at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:957)
> at
> java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1863)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1791)
> at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
> at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> ... 30 more
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.