InAnYan / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
0 stars 0 forks source link

JabRef doesn't quit #178

Open koppor opened 2 months ago

koppor commented 2 months ago

image

All UI is closed, but the "run" task is still active.

I had a group chat opened.

InAnYan commented 2 months ago

I pushed some fix for this.

My guess: probably the PDF reading part was not closed

koppor commented 2 months ago

No...

image

koppor commented 2 months ago

I think, it is because of the thing @loay was reporting at https://github.com/JabRef/jabref/issues/11701

ERROR: Got an error while sending a message to AI: java.lang.RuntimeException: ai.djl.translate.TranslateException: java.lang.IllegalStateException: NDManager has been closed already.
        at org.jabref@100.0.0/org.jabref.logic.ai.ingestion.model.DeepJavaEmbeddingModel.embedAll(DeepJavaEmbeddingModel.java:47)
        at org.jabref@100.0.0/org.jabref.logic.ai.ingestion.model.JabRefEmbeddingModel.embedAll(JabRefEmbeddingModel.java:131)
        at langchain4j.core@0.33.0/dev.langchain4j.model.embedding.EmbeddingModel.embed(EmbeddingModel.java:34)
        at langchain4j.core@0.33.0/dev.langchain4j.model.embedding.EmbeddingModel.embed(EmbeddingModel.java:24)
        at langchain4j.core@0.33.0/dev.langchain4j.rag.content.retriever.EmbeddingStoreContentRetriever.retrieve(EmbeddingStoreContentRetriever.java:179)
        at langchain4j.core@0.33.0/dev.langchain4j.rag.DefaultRetrievalAugmentor.process(DefaultRetrievalAugmentor.java:174)
        at langchain4j.core@0.33.0/dev.langchain4j.rag.DefaultRetrievalAugmentor.augment(DefaultRetrievalAugmentor.java:154)
        at langchain4j@0.33.0/dev.langchain4j.chain.ConversationalRetrievalChain.augment(ConversationalRetrievalChain.java:96)
        at langchain4j@0.33.0/dev.langchain4j.chain.ConversationalRetrievalChain.execute(ConversationalRetrievalChain.java:82)
        at langchain4j@0.33.0/dev.langchain4j.chain.ConversationalRetrievalChain.execute(ConversationalRetrievalChain.java:32)
        at org.jabref@100.0.0/org.jabref.logic.ai.chatting.AiChatLogic.execute(AiChatLogic.java:168)
        at org.jabref@100.0.0/org.jabref.gui.ai.components.aichat.AiChatComponent.lambda$onSendMessage$8(AiChatComponent.java:203)
        at org.jabref@100.0.0/org.jabref.gui.util.BackgroundTask$1.call(BackgroundTask.java:82)
        at org.jabref@100.0.0/org.jabref.gui.util.UiTaskExecutor$1.call(UiTaskExecutor.java:170)
        at javafx.graphics@22.0.2/javafx.concurrent.Task$TaskCallable.call(Task.java:1399)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: ai.djl.translate.TranslateException: java.lang.IllegalStateException: NDManager has been closed already.
        at ai.djl.api@0.29.0/ai.djl.inference.Predictor.batchPredict(Predictor.java:196)
        at ai.djl.api@0.29.0/ai.djl.inference.Predictor.predict(Predictor.java:132)
        at org.jabref@100.0.0/org.jabref.logic.ai.ingestion.model.DeepJavaEmbeddingModel.embedAll(DeepJavaEmbeddingModel.java:33)
        ... 20 more
Caused by: java.lang.IllegalStateException: NDManager has been closed already.
        at ai.djl.api@0.29.0/ai.djl.ndarray.BaseNDManager.attachUncappedInternal(BaseNDManager.java:328)
        at ai.djl.pytorch_engine@0.29.0/ai.djl.pytorch.engine.PtNDManager.newSubManager(PtNDManager.java:185)
        at ai.djl.pytorch_engine@0.29.0/ai.djl.pytorch.engine.PtNDManager.newSubManager(PtNDManager.java:31)
        at ai.djl.api@0.29.0/ai.djl.ndarray.BaseNDManager.newSubManager(BaseNDManager.java:265)
        at ai.djl.api@0.29.0/ai.djl.inference.Predictor$PredictorContext.<init>(Predictor.java:363)
        at ai.djl.api@0.29.0/ai.djl.inference.Predictor.batchPredict(Predictor.java:158)
        ... 22 more
2024-09-04 14:38:36 [main] org.jabref.Launcher.main()
ERROR: Unexpected exception: java.lang.RuntimeException: Exception in Application stop method
        at javafx.graphics@22.0.2/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:898)
        at javafx.graphics@22.0.2/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:196)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.util.NoSuchElementException: java.lang.IndexOutOfBoundsException
        at java.base/java.util.AbstractList$Itr.next(AbstractList.java:379)
        at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
        at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1939)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
        at org.jabref@100.0.0/org.jabref.gui.util.UiTaskExecutor.shutdown(UiTaskExecutor.java:131)
        at org.jabref@100.0.0/org.jabref.gui.JabRefGUI.shutdownThreadPools(JabRefGUI.java:382)
        at org.jabref@100.0.0/org.jabref.gui.JabRefGUI.stop(JabRefGUI.java:372)
        at javafx.graphics@22.0.2/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$10(LauncherImpl.java:858)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
        at javafx.graphics@22.0.2/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at javafx.graphics@22.0.2/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics@22.0.2/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
        ... 1 more
Caused by: java.lang.IndexOutOfBoundsException
        at javafx.base@22.0.2/javafx.collections.transformation.FilteredList.get(FilteredList.java:169)
        at com.tobiasdiez.easybind@2.2.1-SNAPSHOT/com.tobiasdiez.easybind.MappedList.get(MappedList.java:31)
        at java.base/java.util.AbstractList$Itr.next(AbstractList.java:373)
        ... 15 more