Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-16934

NoClassDefFoundError Charsets in Java automation client

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.0, 7.2
    • Fix Version/s: 6.0-HF10, 7.3
    • Component/s: Automation
    • Tags:
    • Sprint:
      TGV 7.2-4

      Description

      Create a project that uses the 7.2 automation client that don't inherit from nuxeo addons pom.
      When I run a simple test to create a document, I get a NoClassDefFoundError. The first part of the stack trace is: java.lang.NoClassDefFoundError: org/apache/commons/codec/Charsets
      Actually it seems that by default it uses the comons-codec 1.6 that doesn't include the Charset class.
      The issue is fixed when we specify in the maven project dependencies to use the commons-codec 1.9 (the one used in the automation server)

      Even when using the shaded automation client with all jars dependencies it fails because commons-codec has been excluded.

      A workaround could be to use java.nio.charset.StandardCharsets in /nuxeo-features/nuxeo-automation/nuxeo-automation-client/src/main/java/org/nuxeo/ecm/automation/client/jaxrs/impl/HttpConnector.java

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: