Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JabRef Citation Style Generation Error: Issues in BST Function Processing #12799

Open
2 tasks done
marwanemad07 opened this issue Mar 22, 2025 · 11 comments
Open
2 tasks done

Comments

@marwanemad07
Copy link
Contributor

JabRef version

Latest development branch build (please note build date below)

Operating system

Windows

Details on version and operating system

Windows 11

Checked with the latest development build (copy version output from About dialog)

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

If you haven't encountered these exceptions, download the cell.bst style from CTAN and add it via Preferences -> Entry Preview -> Add the downloaded BST file.

  1. Open a LibreOffice Writer
  2. In JabRef, click view in the toolbar and choose OpenOffice/LibreOffice
  3. In the side panel Connect to LibreOffice
  4. Create a new library
  5. Using web search, search for "SW"
  6. Import all the entries

Appendix

...

Exception 1
ERROR: Error while generating citation style: org.jabref.logic.bst.BstVMException: Expecting two integers and a string for substring$ (line 714)
	at [email protected]/org.jabref.logic.bst.BstFunctions.bstSubstring(BstFunctions.java:706)
	at [email protected]/org.jabref.logic.bst.BstFunctions$BstFunction.execute(BstFunctions.java:45)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.resolveIdentifier(BstVMVisitor.java:238)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:250)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$BstFunctionContext.accept(BstParser.java:645)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitStackitem(BstVMVisitor.java:272)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitStackitem(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$StackitemContext.accept(BstParser.java:804)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
	at [email protected]/org.jabref.logic.bst.BstBaseVisitor.visitStack(BstBaseVisitor.java:126)
	at [email protected]/org.jabref.logic.bst.BstParser$StackContext.accept(BstParser.java:744)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstFunctions.callIdentifierOrTree(BstFunctions.java:526)
	at [email protected]/org.jabref.logic.bst.BstFunctions.bstIf(BstFunctions.java:518)
	at [email protected]/org.jabref.logic.bst.BstFunctions$BstFunction.execute(BstFunctions.java:45)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.resolveIdentifier(BstVMVisitor.java:238)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:250)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$BstFunctionContext.accept(BstParser.java:645)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitStackitem(BstVMVisitor.java:272)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitStackitem(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$StackitemContext.accept(BstParser.java:804)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
	at [email protected]/org.jabref.logic.bst.BstBaseVisitor.visitStack(BstBaseVisitor.java:126)
	at [email protected]/org.jabref.logic.bst.BstParser$StackContext.accept(BstParser.java:744)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstFunctions.callIdentifierOrTree(BstFunctions.java:526)
	at [email protected]/org.jabref.logic.bst.BstFunctions.bstIf(BstFunctions.java:520)
	at [email protected]/org.jabref.logic.bst.BstFunctions$BstFunction.execute(BstFunctions.java:45)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.resolveIdentifier(BstVMVisitor.java:238)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:250)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$BstFunctionContext.accept(BstParser.java:645)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitStackitem(BstVMVisitor.java:272)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitStackitem(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$StackitemContext.accept(BstParser.java:804)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
	at [email protected]/org.jabref.logic.bst.BstBaseVisitor.visitStack(BstBaseVisitor.java:126)
	at [email protected]/org.jabref.logic.bst.BstParser$StackContext.accept(BstParser.java:744)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.lambda$visitFunctionCommand$0(BstVMVisitor.java:64)
	at [email protected]/org.jabref.logic.bst.BstFunctions$BstFunction.execute(BstFunctions.java:45)
	at [email protected]/org.jabref.logic.bst.BstFunctions$BstCallTypeFunction.execute(BstFunctions.java:334)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.resolveIdentifier(BstVMVisitor.java:238)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:250)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$BstFunctionContext.accept(BstParser.java:645)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitIterateCommand(BstVMVisitor.java:135)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitIterateCommand(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$IterateCommandContext.accept(BstParser.java:305)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
	at [email protected]/org.jabref.logic.bst.BstBaseVisitor.visitBstFile(BstBaseVisitor.java:21)
	at [email protected]/org.jabref.logic.bst.BstParser$BstFileContext.accept(BstParser.java:117)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstVM.render(BstVM.java:83)
	at [email protected]/org.jabref.logic.bst.BstVM.render(BstVM.java:91)
	at [email protected]/org.jabref.logic.bst.BstPreviewLayout.generatePreview(BstPreviewLayout.java:61)
	at [email protected]/org.jabref.gui.preview.PreviewViewer.lambda$update$3(PreviewViewer.java:204)
	at [email protected]/org.jabref.logic.util.BackgroundTask$1.call(BackgroundTask.java:73)
	at [email protected]/org.jabref.gui.util.UiTaskExecutor$1.call(UiTaskExecutor.java:191)
	at [email protected]/javafx.concurrent.Task$TaskCallable.call(Task.java:1401)
	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:1575)
Exception 2
ERROR: Error while generating citation style: org.jabref.logic.bst.BstVMException: Expecting two integers and a string for substring$ (line 714)
	at [email protected]/org.jabref.logic.bst.BstFunctions.bstSubstring(BstFunctions.java:706)
	at [email protected]/org.jabref.logic.bst.BstFunctions$BstFunction.execute(BstFunctions.java:45)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.resolveIdentifier(BstVMVisitor.java:238)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:250)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$BstFunctionContext.accept(BstParser.java:645)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitStackitem(BstVMVisitor.java:272)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitStackitem(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$StackitemContext.accept(BstParser.java:804)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
	at [email protected]/org.jabref.logic.bst.BstBaseVisitor.visitStack(BstBaseVisitor.java:126)
	at [email protected]/org.jabref.logic.bst.BstParser$StackContext.accept(BstParser.java:744)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstFunctions.callIdentifierOrTree(BstFunctions.java:526)
	at [email protected]/org.jabref.logic.bst.BstFunctions.bstIf(BstFunctions.java:518)
	at [email protected]/org.jabref.logic.bst.BstFunctions$BstFunction.execute(BstFunctions.java:45)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.resolveIdentifier(BstVMVisitor.java:238)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:250)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$BstFunctionContext.accept(BstParser.java:645)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitStackitem(BstVMVisitor.java:272)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitStackitem(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$StackitemContext.accept(BstParser.java:804)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
	at [email protected]/org.jabref.logic.bst.BstBaseVisitor.visitStack(BstBaseVisitor.java:126)
	at [email protected]/org.jabref.logic.bst.BstParser$StackContext.accept(BstParser.java:744)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstFunctions.callIdentifierOrTree(BstFunctions.java:526)
	at [email protected]/org.jabref.logic.bst.BstFunctions.bstIf(BstFunctions.java:520)
	at [email protected]/org.jabref.logic.bst.BstFunctions$BstFunction.execute(BstFunctions.java:45)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.resolveIdentifier(BstVMVisitor.java:238)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:250)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$BstFunctionContext.accept(BstParser.java:645)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitStackitem(BstVMVisitor.java:272)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitStackitem(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$StackitemContext.accept(BstParser.java:804)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
	at [email protected]/org.jabref.logic.bst.BstBaseVisitor.visitStack(BstBaseVisitor.java:126)
	at [email protected]/org.jabref.logic.bst.BstParser$StackContext.accept(BstParser.java:744)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.lambda$visitFunctionCommand$0(BstVMVisitor.java:64)
	at [email protected]/org.jabref.logic.bst.BstFunctions$BstFunction.execute(BstFunctions.java:45)
	at [email protected]/org.jabref.logic.bst.BstFunctions$BstCallTypeFunction.execute(BstFunctions.java:334)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.resolveIdentifier(BstVMVisitor.java:238)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:250)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$BstFunctionContext.accept(BstParser.java:645)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitIterateCommand(BstVMVisitor.java:135)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitIterateCommand(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$IterateCommandContext.accept(BstParser.java:305)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
	at [email protected]/org.jabref.logic.bst.BstBaseVisitor.visitBstFile(BstBaseVisitor.java:21)
	at [email protected]/org.jabref.logic.bst.BstParser$BstFileContext.accept(BstParser.java:117)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstVM.render(BstVM.java:83)
	at [email protected]/org.jabref.logic.bst.BstVM.render(BstVM.java:91)
	at [email protected]/org.jabref.logic.bst.BstPreviewLayout.generatePreview(BstPreviewLayout.java:61)
	at [email protected]/org.jabref.gui.preview.PreviewViewer.lambda$update$3(PreviewViewer.java:204)
	at [email protected]/org.jabref.logic.util.BackgroundTask$1.call(BackgroundTask.java:73)
	at [email protected]/org.jabref.gui.util.UiTaskExecutor$1.call(UiTaskExecutor.java:191)
	at [email protected]/javafx.concurrent.Task$TaskCallable.call(Task.java:1401)
	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:1575)
Exception 3
ERROR: Error while generating citation style: java.lang.IllegalArgumentException: Illegal group reference: group index is missing
	at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1073)
	at java.base/java.util.regex.Matcher.appendReplacement(Matcher.java:1041)
	at [email protected]/org.jabref.logic.bst.BstFunctions.bstAddPeriod(BstFunctions.java:295)
	at [email protected]/org.jabref.logic.bst.BstFunctions$BstFunction.execute(BstFunctions.java:45)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.resolveIdentifier(BstVMVisitor.java:238)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:250)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitBstFunction(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$BstFunctionContext.accept(BstParser.java:645)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitStackitem(BstVMVisitor.java:272)
	at [email protected]/org.jabref.logic.bst.BstVMVisitor.visitStackitem(BstVMVisitor.java:23)
	at [email protected]/org.jabref.logic.bst.BstParser$StackitemContext.accept(BstParser.java:804)
	at [email protected]/org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46)
@subhramit
Copy link
Member

subhramit commented Mar 22, 2025

@marwanemad07 Is this reproducible with only steps 4, 5 and 6? LibreOffice currently does not have an option to work with BST (we have that as a GSoC project this year) - so I am unsure about the relevance of steps 1, 2 and 3.

This seems more of an issue with the BST Preview...
Wdyt @Siedlerchr?

Update: Also hinted by:

	at [email protected]/org.jabref.logic.bst.BstPreviewLayout.generatePreview(BstPreviewLayout.java:61)
	at [email protected]/org.jabref.gui.preview.PreviewViewer.lambda$update$3(PreviewViewer.java:204)

@Siedlerchr
Copy link
Member

Yes, Libre office is irrelevant just BST preview.

@priyanshu16095
Copy link
Contributor

Recording.2025-03-23.mp4

Is it the same process? Its not happening with me.

@marwanemad07
Copy link
Contributor Author

Is this reproducible with only steps 4, 5 and 6?

I tried to check the preview of BST before making the issue, but no exceptions were raised. but as the hint showed it's because of the preview layout.

@marwanemad07
Copy link
Contributor Author

Is it the same process? Its not happening with me.

I have just tried it again and the same exceptions were raised, can you try to select all entries?

@priyanshu16095
Copy link
Contributor

Tried selecting all entries, but still nothing happens.
If possible could you share some more details or a screenshot.

@marwanemad07
Copy link
Contributor Author

Tried selecting all entries, but still nothing happens. If possible could you share some more details or a screenshot.

recording-2025-03-24-00-34-51.mp4

@subhramit
Copy link
Member

I tried to check the preview of BST before making the issue, but no exceptions were raised. but as the hint showed it's because of the preview layout.

So steps 1, 2 and 3 are compulsory? Otherwise the exceptions don't occur?

@subhramit
Copy link
Member

Tried selecting all entries, but still nothing happens. If possible could you share some more details or a screenshot.

recording-2025-03-24-00-34-51.mp4

Also, what is that UnsatisfiedLinkError you are getting when connecting to LibreOffice?

@marwanemad07
Copy link
Contributor Author

So steps 1, 2 and 3 are compulsory? Otherwise the exceptions don't occur?

I tried it now, but they are not compulsory.

@marwanemad07
Copy link
Contributor Author

Also, what is that UnsatisfiedLinkError you are getting when connecting to LibreOffice?

It's related to PyTorch, This exception is since I used JabRef for the first time, I think it's related to something in my environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Normal priority
Development

No branches or pull requests

4 participants