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

ExceptionInInitializerError on version 6.4 #10555

Open
binarynoise opened this issue May 1, 2024 · 10 comments
Open

ExceptionInInitializerError on version 6.4 #10555

binarynoise opened this issue May 1, 2024 · 10 comments

Comments

@binarynoise
Copy link

binarynoise commented May 1, 2024

after uptating my server to 6.4, languagetool now crashes on startup.

[languagetool@languagetool ~]$ languagetool --http -p 8000 --public --allow-origin "*" --config /home/languagetool/languagetool.conf
Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.languagetool.JLanguageTool.<clinit>(JLanguageTool.java:84)
	at org.languagetool.Premium.isPremiumVersion(Premium.java:64)
	at org.languagetool.server.DatabaseAccess.init(DatabaseAccess.java:57)
	at org.languagetool.server.HTTPServer.main(HTTPServer.java:171)
Caused by: java.lang.NullPointerException: text
	at java.util.Objects.requireNonNull(Objects.java:228)
	at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1848)
	at java.time.OffsetDateTime.parse(OffsetDateTime.java:402)
	at org.languagetool.LtBuildInfo.<init>(LtBuildInfo.java:64)
	at org.languagetool.LtBuildInfo.<clinit>(LtBuildInfo.java:37)
	... 4 more
[languagetool@languagetool ~]$ cat languagetool.conf
languageModel=/home/languagetool/ngram
fasttextModel=/home/languagetool/lid.176.bin
fasttextBinary=/usr/bin/fasttext
pipelineCaching=true
pipelinePrewarming=true
maxPipelinePoolSize=500
cacheSize=2

Downgrading to 6.3.a does not crash.
I'm using the binary provided by the arch linux package

@danielnaber
Copy link
Member

I cannot reproduce that when starting the JAR from the LT 6.4 ZIP files we provide. It looks like a packaging issue. Do you know what the actual commend is that gets executed by languagetool?

@binarynoise
Copy link
Author

languagetool looks like a shell script to build the java command and eventually runs

/bin/java
-cp /usr/share/languagetool:/usr/share/java/languagetool/languagetool-commandline.jar:/usr/share/java/languagetool/languagetool-server.jar:/usr/share/java/languagetool/languagetool.jar
org.languagetool.server.HTTPServer
-p 8000 --public --allow-origin * --config /home/languagetool/languagetool.conf

(wrapped for readability)

@binarynoise
Copy link
Author

here's the source for the wrapper:
https://gitlab.archlinux.org/archlinux/packaging/packages/languagetool/-/blob/main/languagetool.sh

I'll try to build the package myself and see how that goes

@danielnaber
Copy link
Member

Does it make a difference if you run the command from the directory that contains languagetool-commandline.jar? Or from /usr/share/languagetool?

@binarynoise
Copy link
Author

It does not seem to make a difference from where I run the full command.

@binarynoise
Copy link
Author

looking at the code, it looks like git.properties isn't found

@binarynoise
Copy link
Author

binarynoise commented May 1, 2024

the file is where it should be, so it's probably a problem with invoking the jars or it's not able to properly read the file, but it doesn't log the warning either

@binarynoise
Copy link
Author

It's definitely some kind of packaging thing.
Downloading the release zip, extracting it and running the command as in the docs successfully starts the server.

@binarynoise
Copy link
Author

@binarynoise
Copy link
Author

binarynoise commented May 2, 2024

I just found the reason.
There was a stray, empty git-premium.properties in /usr/share/languagetool, getting rid of that solves the issue.
So it wasn't a packaging issue.
I wonder why it still worked on 6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants