Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-1999

java.lang.ClassCastException: org.jets3t.service.utils.RestUtils.ConnManagerFactory cannot be cast to org.apache.http.conn.ClientConnectionManagerFactory

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 4.5.6
    • Fix Version/s: None
    • Component/s: HttpClient (classic)
    • Labels:
      None

      Description

      In our apache spark2.4.3 applications, we upload files to s3 using jets3t and httpclient-4.5.6, and get the errors.

      Caused by: org.jets3t.service.ServiceException: Request Error: java.lang.ClassCastException: org.jets3t.service.utils.RestUtils.ConnManagerFactory cannot be cast to org.apache.http.conn.ClientConnectionManagerFactory
              at org.jets3t.service.impl.rest.httpclient.RestStorageService.performRequest(RestStorageService.java:574)
              at org.jets3t.service.impl.rest.httpclient.RestStorageService.performRequest(RestStorageService.java:281)
              at org.jets3t.service.impl.rest.httpclient.RestStorageService.performRestHead(RestStorageService.java:942)
              at org.jets3t.service.impl.rest.httpclient.RestStorageService.getObjectImpl(RestStorageService.java:2148)
              at org.jets3t.service.impl.rest.httpclient.RestStorageService.getObjectDetailsImpl(RestStorageService.java:2075)
              at org.jets3t.service.StorageService.getObjectDetails(StorageService.java:1093)
              at org.jets3t.service.StorageService.getObjectDetails(StorageService.java:548)
              at org.apache.hadoop.fs.s3native.Jets3tNativeFileSystemStore.retrieveMetadata(Jets3tNativeFileSystemStore.java:174)
              ... 79 more
      Caused by: java.lang.ClassCastException: org.jets3t.service.utils.RestUtils.ConnManagerFactory cannot be cast to org.apache.http.conn.ClientConnectionManagerFactory
              at org.apache.http.impl.client.AbstractHttpClient.createClientConnectionManager(AbstractHttpClient.java:284)
              at org.apache.http.impl.client.AbstractHttpClient.getConnectionManager(AbstractHttpClient.java:437)
              at org.apache.http.impl.client.AbstractHttpClient.createHttpContext(AbstractHttpClient.java:246)
              at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:771)
              at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
              at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
              at org.jets3t.service.impl.rest.httpclient.RestStorageService.performRequest(RestStorageService.java:334)
              ... 86 more
      

      We return back to httpclient-4.5.2, and everything is fine.
      I notice that the HTTPCLIENT-1727 contextLoader is `org.apache.spark.sql.hive.client.IsolatedClientLoader#classLoader` in spark, so i'm not sure if it's spark's problems. Thanks.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              514793425@qq.com ChenKai
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: