Dear all,

I have found exactly what breaks my test case, but I don't understand why. The 
code sample shows what happens and you can find a typical log in my previous 
mail. Apparently I can successfully connect once and retrieve an answer once, 
but second request will fail with SSL Handshake error.

Please point me in the direction to go to fix this "feature".

Can there be an issue of AXIS libraries not only using the HttpClient for 
connections?

\pgj

//---------------------------
// Code, that fails
//---------------------------
// Get joblist
JobInfo[] jobList = (JobInfo[])DbserverStubTest.jobListResponse.getResponse();

// Setup trust
this.activateTrust();
if(DbserverStubTest.sslFactory == null) {
        DbserverStubTest.fatalError = true;
        Assert.fail();
        return;
}
// Define new protocol
Protocol trustHttps = new Protocol("https", DbserverStubTest.sslFactory, 6001);
Protocol.registerProtocol("https", trustHttps);

// Loop joblist and delete jobs
for(int i=0; i<jobList.length; ++i) {
        // Don't deleted shared jobs (public)
        if(!jobList[i].localFIsPublic) {
                UnsignedInt jobId = jobList[i].getUiJobId();
                DeleteJob deleteJob = new DeleteJob();
                deleteJob.setSzUser(DbserverStubTest.user.userName);
                deleteJob.setUiJobId(jobId);
                try {
                        log.debug("Will delete private job: "+jobId);
                        DeleteJobStatus deleteStatus = 
DbserverStubTest.dbserverStub.DeleteJob(deleteJob);
                        if(!deleteStatus.localFDeleteOK) {
                                log.debug("DeleteStatus: 
"+deleteStatus.localSzErrorMsg);
                        }
                        Thread.sleep(1000l);
                } catch (RemoteException e) {
                        log.error("RemoteException: "+e.getMessage());
                        log.debug("StackTrace: ",e);
                        DbserverStubTest.fatalError = true;
                        Assert.fail();
                } catch (InterruptedException e) {
                        log.error("InterruptedException: "+e.getMessage());
                        log.debug("StackTrace: ",e);
                        DbserverStubTest.fatalError = true;
                        Assert.fail();
                }
                // If I uncomment the break statement, the test will succeed.
                // In other words the second request will always fail!
                //break;  <-- 
        }
} 




> -----Oprindelig meddelelse-----
> Fra: Peter Gylling Jørgensen [mailto:[EMAIL PROTECTED] 
> Sendt: 11. april 2007 15:08
> Til: [EMAIL PROTECTED]
> Emne: CustomSSLSocketFactory combined with Axis2 - works 
> once, but not several times?
> 
> Dear all,
> 
> I would like a little help on this issue.
> 
> I have a AXIS2 v. 1.1.1 client code which talks to a HTTPS 
> based OpenSSL SOAP service. 
> 
> So far so good. I can do the following:
> 
> 1. Connect with a standalone HttpClient using a custom 
> SSLSocketFactory and a custom Protocol
> 
> So I know I have a solution for solving how the client and 
> server communicates together, but I cannot make the AXIS2 
> client talk fluently to the server.
> 
> In my unit test code, I have say 5 different connections to 
> request different methods to be excecuted on the server, an 
> usually the first and the second will work, then the third 
> will fail, no matter the sequence
> 
> Below you will find the usual error, which I need help to 
> find a solution for.
> 
> [DEBUG] 11 Apr 2007 13:03:51,132 
> se.smhi.seatrack.ais.DbserverStubTest.testDeleteJob
>       Will delete private job: 1179
> [INFO ] 11 Apr 2007 13:03:51,163 
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry
>       I/O exception (org.apache.axis2.AxisFault) caught when 
> processing request: Remote host closed connection during 
> handshake; nested exception is: 
>       com.ctc.wstx.exc.WstxIOException: Remote host closed 
> connection during handshake
> [INFO ] 11 Apr 2007 13:03:51,163 
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry
>       Retrying request
> [INFO ] 11 Apr 2007 13:03:51,210 
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry
>       I/O exception (org.apache.axis2.AxisFault) caught when 
> processing request: Remote host closed connection during 
> handshake; nested exception is: 
>       com.ctc.wstx.exc.WstxIOException: Remote host closed 
> connection during handshake
> [INFO ] 11 Apr 2007 13:03:51,210 
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry
>       Retrying request
> [INFO ] 11 Apr 2007 13:03:51,257 
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry
>       I/O exception (org.apache.axis2.AxisFault) caught when 
> processing request: Remote host closed connection during 
> handshake; nested exception is: 
>       com.ctc.wstx.exc.WstxIOException: Remote host closed 
> connection during handshake
> [INFO ] 11 Apr 2007 13:03:51,257 
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry
>       Retrying request
> [ERROR] 11 Apr 2007 13:03:51,288 
> se.smhi.seatrack.ais.DbserverStubTest.testDeleteJob
>       RemoteException: Remote host closed connection during 
> handshake; nested exception is: 
>       com.ctc.wstx.exc.WstxIOException: Remote host closed 
> connection during handshake; nested exception is: 
>       org.apache.axis2.AxisFault: Remote host closed 
> connection during handshake; nested exception is: 
>       com.ctc.wstx.exc.WstxIOException: Remote host closed 
> connection during handshake; nested exception is: 
>       org.apache.axis2.AxisFault: Remote host closed 
> connection during handshake; nested exception is: 
>       com.ctc.wstx.exc.WstxIOException: Remote host closed 
> connection during handshake; nested exception is: 
>       org.apache.axis2.AxisFault: Remote host closed 
> connection during handshake; nested exception is: 
>       com.ctc.wstx.exc.WstxIOException: Remote host closed 
> connection during handshake
> [DEBUG] 11 Apr 2007 13:03:51,288 
> se.smhi.seatrack.ais.DbserverStubTest.testDeleteJob
>       StackTrace: 
> org.apache.axis2.AxisFault: Remote host closed connection 
> during handshake; nested exception is: 
>       com.ctc.wstx.exc.WstxIOException: Remote host closed 
> connection during handshake; nested exception is: 
>       org.apache.axis2.AxisFault: Remote host closed 
> connection during handshake; nested exception is: 
>       com.ctc.wstx.exc.WstxIOException: Remote host closed 
> connection during handshake; nested exception is: 
>       org.apache.axis2.AxisFault: Remote host closed 
> connection during handshake; nested exception is: 
>       com.ctc.wstx.exc.WstxIOException: Remote host closed 
> connection during handshake; nested exception is: 
>       org.apache.axis2.AxisFault: Remote host closed 
> connection during handshake; nested exception is: 
>       com.ctc.wstx.exc.WstxIOException: Remote host closed 
> connection during handshake
>       at 
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.inv
> oke(CommonsHTTPTransportSender.java:227)
>       at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:674)
>       at 
> org.apache.axis2.description.OutInAxisOperationClient.send(Out
> InAxisOperation.java:237)
>       at 
> org.apache.axis2.description.OutInAxisOperationClient.execute(
> OutInAxisOperation.java:202)
>       at 
> se.smhi.seatrack.ais.DbserverStub.DeleteJob(DbserverStub.java:446)
>       at 
> se.smhi.seatrack.ais.DbserverStubTest.testDeleteJob(DbserverSt
> ubTest.java:469)
> 
> ..... <cut> .....
> 
> Caused by: javax.net.ssl.SSLHandshakeException: Remote host 
> closed connection during handshake
>       at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
>       at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA12275)
>       at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
>       at 
> com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA12275)
>       at 
> java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
>       at 
> java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)
>       at 
> org.apache.commons.httpclient.ChunkedOutputStream.flush(Chunke
> dOutputStream.java:190)
>       at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:99)
>       at 
> com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:184)
>       at 
> com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:311)
>       ... 38 more
> Caused by: java.io.EOFException: SSL peer shut down incorrectly
>       at com.sun.net.ssl.internal.ssl.InputRecord.read(DashoA12275)
>       ... 48 more
> 
> \pgj
> --
> Peter Gylling Jørgensen
> Modelling group, section of Oceanography
> Royal Danish Administration of Navigation and Hydrography 
> Overgaden o. Vandet 62B DK-1023 København K 
> Phone: +45 32 68 96 85
> Email: [EMAIL PROTECTED]
> www: http://www.frv.dk/ 
>  
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to