Skip to content

NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest when running standalone script #28

@pixeline

Description

@pixeline

Description

When executing the Oxalis-NG standalone script (/oxalis-ng/bin-standalone/run-docker.sh) via docker exec, the application fails to initialize with a NoClassDefFoundError for Apache HttpClient classes. The error occurs during the initialization of the main class network.oxalis.ng.Main, indicating that required dependencies are not available on the classpath.

Error Message:

Error: Unable to initialize main class network.oxalis.ng.Main
Caused by: java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest

This suggests that the standalone script's classpath configuration is missing the Apache HttpClient library (httpclient), which is required by Oxalis-NG for HTTP operations.

Reproduce

  1. Start Oxalis-NG container using Docker image norstella/oxalis-ng:1.2.0
  2. Write a valid PEPPOL document (SBDH XML) to the outbound directory: /oxalis-ng/outbound/{document_id}.xml
  3. Execute the standalone script via docker exec:
    docker exec oxalis-ap /oxalis-ng/bin-standalone/run-docker.sh -f /oxalis-ng/outbound/{document_id}.xml
  4. Observe the NoClassDefFoundError in the command output

Example command:

docker exec oxalis-ap /oxalis-ng/bin-standalone/run-docker.sh -f /oxalis-ng/outbound/46a1ab0e-a38b-476f-8000-0b22c1dcf897.xml

Expected Output:
The script should successfully process the document and send it via the PEPPOL network.

Actual Output:

Error: Unable to initialize main class network.oxalis.ng.Main
Caused by: java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest

Expected behavior

The standalone script should:

  1. Successfully initialize the network.oxalis.ng.Main class
  2. Load all required dependencies, including Apache HttpClient
  3. Process the document and send it via the PEPPOL network
  4. Return exit code 0 on success

The classpath should include all necessary JAR files, including:

  • httpclient-*.jar (Apache HttpClient)
  • All other Oxalis-NG dependencies

Oxalis-NG version

**Version:** `1.2.0`. (also tried with version 1.1.0)
**Docker Image:** `norstella/oxalis-ng:1.2.0`

JDK version

Not explicitly set (using default from Docker image)

Additional Info

Environment

  • JDK Version: Not explicitly set (using default from Docker image)
  • Container Runtime: Docker
  • Execution Method: Via docker exec from external service

Context

This issue occurs when integrating Oxalis-NG with an external gateway service that invokes the standalone script programmatically. The gateway writes PEPPOL documents to the outbound directory and then executes the standalone script to trigger document transmission.

Workaround Attempts

  • Verified that the document XML is valid and properly formatted
  • Confirmed that the file path is correct and accessible within the container
  • Checked that the Oxalis container is running and healthy
  • tried using 1.1.0

Related Configuration

The issue appears to be related to how the standalone script (run-docker.sh) constructs the Java classpath. The script may need to explicitly include Apache HttpClient JAR files or ensure they are available in the expected location.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions