opendataloader-project/opendataloader-pdf · error · UnsupportedOperationException

Google Document AI backend is not yet implemented

Error message

Google Document AI backend is not yet implemented

What it means

The 'google' backend type is declared as a constant (BACKEND_GOOGLE) and routed by the factory, but no GoogleHybridClient implementation exists yet. An UnsupportedOperationException signals this is a planned feature. The error is intentionally distinct from the 'Unknown hybrid backend' IllegalArgumentException to distinguish 'recognized but not built' from 'completely unrecognized'.

Source

Thrown at java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/hybrid/HybridClientFactory.java:102

        String lowerHybrid = hybrid.toLowerCase();

        return CLIENT_CACHE.computeIfAbsent(lowerHybrid, key -> createClient(key, config));
    }

    /**
     * Creates a new hybrid client instance.
     */
    private static HybridClient createClient(String hybrid, HybridConfig config) {
        if (BACKEND_DOCLING_FAST.equals(hybrid)) {
            return new DoclingFastServerClient(config);
        } else if (BACKEND_HANCOM.equals(hybrid)) {
            return new HancomClient(config);
        } else if (BACKEND_HANCOM_AI.equals(hybrid)) {
            return new HancomAIClient(config);
        } else if (BACKEND_AZURE.equals(hybrid)) {
            throw new UnsupportedOperationException("Azure Document Intelligence backend is not yet implemented");
        } else if (BACKEND_GOOGLE.equals(hybrid)) {
            throw new UnsupportedOperationException("Google Document AI backend is not yet implemented");
        } else {
            throw new IllegalArgumentException("Unknown hybrid backend: " + hybrid +
                ". Supported backends: " + getSupportedBackends());
        }
    }

    /**
     * Creates a hybrid client for the specified backend.
     *
     * @param hybrid The backend type (e.g., "docling", "hancom", "azure", "google").
     * @param config The configuration for the hybrid client.
     * @return A new HybridClient instance for the specified backend.
     * @throws IllegalArgumentException If the backend type is unknown or not supported.
     * @deprecated Use {@link #getOrCreate(String, HybridConfig)} instead to reuse clients.
     */
    @Deprecated
    public static HybridClient create(String hybrid, HybridConfig config) {
        return getOrCreate(hybrid, config);

View on GitHub (pinned to a7789b8e77)

Solutions

  1. Use a currently-implemented backend instead: 'docling-fast', 'hancom', or 'hancom-ai'.
  2. If Google Document AI is required, call it directly via the Google Cloud Document AI client library and adapt the output.
  3. Check the project roadmap for when Google backend support is planned.
  4. Contribute a GoogleHybridClient implementation following the HybridClient interface.

Example fix

// before: google is not yet implemented
HybridClient client = HybridClientFactory.getOrCreate("google", config);

// after: use an implemented backend
HybridClient client = HybridClientFactory.getOrCreate("hancom", config);
// or call Google Document AI directly via google-cloud-documentai SDK
Defensive patterns

Strategy: validation

Validate before calling

// Validate backend is implemented before calling the factory
Set<String> implementedBackends = Set.of(
    HybridClientFactory.BACKEND_DOCLING_FAST,
    HybridClientFactory.BACKEND_HANCOM,
    HybridClientFactory.BACKEND_HANCOM_AI
);
if (!implementedBackends.contains(backend)) {
    throw new IllegalArgumentException(
        "Backend '" + backend + "' is not yet implemented. Available: " + implementedBackends);
}

Type guard

public static boolean isImplementedBackend(String backend) {
    return HybridClientFactory.BACKEND_DOCLING_FAST.equals(backend)
        || HybridClientFactory.BACKEND_HANCOM.equals(backend)
        || HybridClientFactory.BACKEND_HANCOM_AI.equals(backend);
}

Try / catch

try {
    client = HybridClientFactory.getOrCreate(backend, config);
} catch (UnsupportedOperationException e) {
    if (e.getMessage().contains("not yet implemented")) {
        LOGGER.warning("Backend '" + backend + "' not implemented. Falling back to 'hancom'.");
        client = HybridClientFactory.getOrCreate(HybridClientFactory.BACKEND_HANCOM, config);
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Calling HybridClientFactory.getOrCreate('google', config) or HybridClientFactory.create('google', config). The factory matches BACKEND_GOOGLE and throws the stub exception. This can occur when a configuration file or CLI default references 'google' expecting Google Document AI support.

Common situations: Project documentation mentions Google Document AI as a future backend; a user migrating from a Google-Cloud-centric workflow defaults to 'google'; the Javadoc on getOrCreate lists 'google' as an example backend name, creating false expectations.

Related errors


AI-assisted analysis of opendataloader-project/opendataloader-pdf@a7789b8e77 (2026-08-14). Data as JSON: /api/errors/c253f3c71cc7d93f. Report an issue: GitHub.