docling-java icon indicating copy to clipboard operation
docling-java copied to clipboard

Exception using docling-serve-client

Open lordofthejars opened this issue 7 months ago • 3 comments

Hi I created the example of the website Getting Started in a simple vanilla Java project using only the following dependency:

<dependencies>
        <dependency>
            <groupId>ai.docling</groupId>
            <artifactId>docling-serve-client</artifactId>
            <version>0.5.1</version>
        </dependency>
    </dependencies>

But when I run it, I get the following exception. My question here (should we provide one), and if not, could we make the exception message like in Quarkus, which gives you the final solution by, for example, providing the coordinates?

Exception in thread "main" java.lang.IllegalStateException: Neither Jackson 2 or 3 is on the classpath
	at ai.docling.serve.client.DoclingServeClientBuilderFactory.newBuilder(DoclingServeClientBuilderFactory.java:49)
	at ai.docling.serve.client.DoclingServeClientBuilderFactory.newBuilder(DoclingServeClientBuilderFactory.java:70)
	at ai.docling.serve.client.DoclingServeClientBuilderFactory.getBuilder(DoclingServeClientBuilderFactory.java:75)
	at ai.docling.serve.api.DoclingServeApi.builder(DoclingServeApi.java:47)
	at org.acme.MainApp.main(MainApp.java:15)

lordofthejars avatar Apr 24 '26 15:04 lordofthejars

This is a good idea!

edeandrea avatar Apr 26 '26 13:04 edeandrea

So we can't provide the dependency with docling because we support both and we don't want to force one over the other, but we surely can make the error message better.

If you're using the quarkus docling extension then you will never run into this issue since it forces the correct dependency (because Quarkus forces it).

edeandrea avatar Apr 28 '26 01:04 edeandrea

🎉 This issue has been resolved in v0.5.2 (Release Notes)

docling-java-ops[bot] avatar May 05 '26 16:05 docling-java-ops[bot]