How can I avoid Time out Exception and force my code to wait response ?

my code

        doc = repository.timeout(60).readTimeout(60).writeTimeout(60).createDocumentByPath(pathDoc, doc);

Exception is org.nuxeo.client.spi.NuxeoClientException: Error during call on Nuxeo server

    at org.nuxeo.client.NuxeoClient.fetchResponse(NuxeoClient.java:278)
    at org.nuxeo.client.objects.AbstractConnectable.fetchResponse(AbstractConnectable.java:65)
    at org.nuxeo.client.objects.user.UserManager.fetchCurrentUser(UserManager.java:75)
    at org.nuxeo.client.NuxeoClient$Builder.connect(NuxeoClient.java:501)
    at com.migrationFileNetToNuxeo.Migration.util.NuxeoDocService.creeateDoc(NuxeoDocService.java:35)
    at com.migrationFileNetToNuxeo.Migration.service.MigrationService$1.run(MigrationService.java:209)

Caused by: java.net.SocketTimeoutException: timeout

    at okio.SocketAsyncTimeout.newTimeoutException(Okio.kt:159)
    at okio.AsyncTimeout.exit$jvm(AsyncTimeout.kt:203)
    at okio.AsyncTimeout$source$1.read(AsyncTimeout.kt:163)
    at okio.RealBufferedSource.indexOf(RealBufferedSource.kt:349)
    at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.kt:222)
    at okhttp3.internal.http1.Http1ExchangeCodec.readHeaderLine(Http1ExchangeCodec.java:242)
    at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.java:213)
    at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.java:115)
    at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:94)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:43)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
    at org.nuxeo.client.objects.AbstractBase.lambda$header$3(AbstractBase.java:206)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
    at org.nuxeo.client.spi.auth.BasicAuthInterceptor.intercept(BasicAuthInterceptor.java:59)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
    at okhttp3.RealCall.execute(RealCall.java:81)
    at retrofit2.OkHttpCall.execute(OkHttpCall.java:186)
    at org.nuxeo.client.NuxeoClient.fetchResponse(NuxeoClient.java:274)

dependency ->

<dependency>
        <groupId>org.nuxeo.client</groupId>
        <artifactId>nuxeo-java-client</artifactId>
        <version>3.6.0</version>
    </dependency>
0 votes

0 answers

270 views

ANSWER