Tried Mistral AI, it did not work but now I can't run JabRef it at all

I tried to use Mistral AI, I uploaded my API code and it did not work and returned me some weird error.

java.util.ServiceConfigurationError: dev.langchain4j.model.mistralai.spi.MistralAiChatModelBuilderFactory: module langchain4j.core does not declare `uses`

For me it looked like some problem with communication with some java module

As I had aplha version from may or so I decided to try update it to the latest version and now I can’t run it at all, probably because it’s trying to use the Aistral AI module. So far I have not been able to run it successfully.

I use latest debian testing, kernel 7.1.12+deb14-amd64 #1 SMP PREEMPT_DYNAMIC Debian 7.1.12-1 (2026-08-28)

And I get this error on the start of JabRef

java.util.ServiceConfigurationError: dev.langchain4j.model.mistralai.spi.MistralAiChatModelBuilderFactory: module langchain4j.core does not declare uses
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:559)
at java.base/java.util.ServiceLoader.checkCaller(ServiceLoader.java:545)
at java.base/java.util.ServiceLoader.(ServiceLoader.java:480)
at java.base/java.util.ServiceLoader.load(ServiceLoader.java:1547)
at langchain4j.core@1.20.0/dev.langchain4j.spi.ServiceHelper.loadFactories(ServiceHelper.java:74)
at langchain4j.core@1.20.0/dev.langchain4j.spi.ServiceHelper.loadFactories(ServiceHelper.java:47)
at langchain4j.core@1.20.0/dev.langchain4j.model.mistralai.MistralAiChatModel.builder(MistralAiChatModel.java:158)
at org.jabref.jablib/org.jabref.logic.ai.chatting.util.ChatModelFactory.create(ChatModelFactory.java:65)
at org.jabref.jablib/org.jabref.logic.ai.chatting.util.ChatModelFactory.create(ChatModelFactory.java:86)
at org.jabref.jablib/org.jabref.logic.ai.AiService.lambda$new$0(AiService.java:104)
at org.jabref.jablib/org.jabref.logic.util.ObservablesHelper$1.computeValue(ObservablesHelper.java:81)
at org.jabref.jablib/org.jabref.logic.util.ObservablesHelper$1.computeValue(ObservablesHelper.java:63)
at javafx.base@26.0.2/javafx.beans.binding.ObjectBinding.get(ObjectBinding.java:168)
at javafx.base@26.0.2/javafx.beans.binding.ObjectExpression.getValue(ObjectExpression.java:51)
at javafx.base@26.0.2/com.sun.javafx.binding.ExpressionHelper.addListener(ExpressionHelper.java:64)
at javafx.base@26.0.2/javafx.beans.binding.ObjectBinding.addListener(ObjectBinding.java:86)
at javafx.base@26.0.2/javafx.beans.property.ObjectPropertyBase.bind(ObjectPropertyBase.java:174)
at org.jabref.jablib/org.jabref.logic.ai.AiService.(AiService.java:103)
at org.jabref/org.jabref.gui.JabRefGUI.initialize(JabRefGUI.java:260)
at org.jabref/org.jabref.gui.JabRefGUI.start(JabRefGUI.java:129)
at javafx.graphics@26.0.2/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$4(LauncherImpl.java:845)
at javafx.graphics@26.0.2/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$0(PlatformImpl.java:449)
at javafx.graphics@26.0.2/com.sun.javafx.application.PlatformImpl.lambda$runLater$0(PlatformImpl.java:424)
at javafx.graphics@26.0.2/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at javafx.graphics@26.0.2/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at javafx.graphics@26.0.2/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$0(GtkApplication.java:242)
at java.base/java.lang.Thread.run(Thread.java:1474)

Thank you for reporting the issue.

I tried to fix at Fix JabRef not starting when Mistral AI is the AI provider by koppor · Pull Request #17212 · JabRef/jabref · GitHub

Can you try? We have a how to at How to try out any JabRef pull request | JabRef's Blog

Cheers,

Oliver

Hi!
When I came back from walk it was already merged with main, but yes, it worked. Thank you!

I still have some issue with the mistral api. It does not generate anything but my mistral admin page says, it already did 139 api requests. But clicked the button “regenerate summary” only 2x. (By does not generate anything I mean it looks like it’s still working but it takes several minutes and nothing cames out of it and when I go to different tab and back it still shows the old error I posted earlier - which I think is maybe just stucked “last generated response” there. I tried different mistral AI models without any success, just the default one returns that error.) But I don’t think I now have the capacity/time to dig deeper to describe it better, sorry, and I just won’t use it.

I have a hunch.

Please

  • show a screenshot of your AI preferences expert settings and miscellaneous.
  • set the context window to 1000000.
  • try summarization engine: Full Document

The default summarization engine is “Chunked”. The original idea was that with a limited context window, a text would be broken up into multiple chunks and each chunk would get summarized and at the end there would be a summary of the summaries. The chunking engine would explain the 139 api requests. I think the context window handling needs some rethinking.

I can reproduce (using koboldcpp and a local model) that when using the chunking summarization algorithm and if the context window is too small (e.g. 3000) while I try to ingest a twelve pages document, I get the following error:

java.io.UncheckedIOException: Could not connect to http://localhost:5001.

EOF reached while reading
	at org.jabref.jablib/org.jabref.logic.ai.chatting.JvmOpenAiChatLanguageModel.chat(JvmOpenAiChatLanguageModel.java:89)
	at org.jabref.jablib/org.jabref.logic.ai.chatting.util.ChatModelFactory$ChatModelImpl.chat(ChatModelFactory.java:126)
	at org.jabref.jablib/org.jabref.logic.ai.summarization.logic.summarizationalgorithms.ChunkedSummarizator.summarizeChunk(ChunkedSummarizator.java:107)
	at org.jabref.jablib/org.jabref.logic.ai.summarization.logic.summarizationalgorithms.ChunkedSummarizator.summarizeChunks(ChunkedSummarizator.java:94)
	at org.jabref.jablib/org.jabref.logic.ai.summarization.logic.summarizationalgorithms.ChunkedSummarizator.summarize(ChunkedSummarizator.java:54)
	at org.jabref.jablib/org.jabref.logic.ai.summarization.logic.BibEntrySummarizator.generateSummary(BibEntrySummarizator.java:117)
	at org.jabref.jablib/org.jabref.logic.ai.summarization.logic.BibEntrySummarizator.summarize(BibEntrySummarizator.java:56)
	at org.jabref.jablib/org.jabref.logic.ai.summarization.tasks.GenerateSummaryTask.perform(GenerateSummaryTask.java:42)
	at org.jabref.jablib/org.jabref.logic.ai.summarization.tasks.GenerateSummaryTask.perform(GenerateSummaryTask.java:11)
	at org.jabref.jablib/org.jabref.logic.ai.util.TrackedBackgroundTask.call(TrackedBackgroundTask.java:42)
	at org.jabref/org.jabref.gui.util.UiTaskExecutor$1.call(UiTaskExecutor.java:224)
	at javafx.graphics@26.0.2/javafx.concurrent.Task$TaskCallable.call(Task.java:1407)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
	at java.base/java.lang.Thread.run(Thread.java:1474)
Caused by: java.io.IOException: HTTP/1.1 header parser received no bytes
	at java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:938)
	at java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:133)
	at jvm.openai@0.11.0/io.github.stefanbratanov.jvm.openai.OpenAIClient.sendHttpRequest(OpenAIClient.java:84)
	at jvm.openai@0.11.0/io.github.stefanbratanov.jvm.openai.OpenAIClient.sendHttpRequest(OpenAIClient.java:78)
	at jvm.openai@0.11.0/io.github.stefanbratanov.jvm.openai.ChatClient.createChatCompletion(ChatClient.java:37)
	at org.jabref.jablib/org.jabref.logic.ai.chatting.JvmOpenAiChatLanguageModel.chat(JvmOpenAiChatLanguageModel.java:78)
	... 17 more
Caused by: java.io.IOException: HTTP/1.1 header parser received no bytes
	at java.net.http/jdk.internal.net.http.common.Utils.wrapWithExtraDetail(Utils.java:456)
	at java.net.http/jdk.internal.net.http.Http1Response$HeadersReader.onReadError(Http1Response.java:591)
	at java.net.http/jdk.internal.net.http.Http1AsyncReceiver.checkForErrors(Http1AsyncReceiver.java:304)
	at java.net.http/jdk.internal.net.http.Http1AsyncReceiver.flush(Http1AsyncReceiver.java:270)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask.run(SequentialScheduler.java:182)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:149)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:207)
	... 3 more
Caused by: java.io.EOFException: EOF reached while reading
	at java.net.http/jdk.internal.net.http.Http1AsyncReceiver$Http1TubeSubscriber.onComplete(Http1AsyncReceiver.java:603)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$ReadSubscription.signalCompletion(SocketTube.java:652)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.read(SocketTube.java:883)
	at java.net.http/jdk.internal.net.http.SocketTube$SocketFlowTask.run(SocketTube.java:181)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:207)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:280)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:233)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$InternalReadSubscription.signalReadable(SocketTube.java:812)
	at java.net.http/jdk.internal.net.http.SocketTube$InternalReadPublisher$ReadEvent.signalEvent(SocketTube.java:1002)
	at java.net.http/jdk.internal.net.http.SocketTube$SocketFlowEvent.handle(SocketTube.java:253)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.handleEvent(HttpClientImpl.java:1439)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.lambda$run$3(HttpClientImpl.java:1384)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$SelectorManager.run(HttpClientImpl.java:1384)

If I set the context window to a huge number, there will be no error. If I set the summarization algorithm to “Full Document”, there will be no error.

Our docs also mention a sliding window, if the number of tokens to ingest exceeds the maximum context window size set in the preferences, which silently trims part of the document. That’s ok in creative workloads, but arguably might be worse than triggering an error message if summarization of scientific documents is the desired use-case. I am not quite sure, if the sliding window applies during summarization. Apparently not, since there was an error.