Mvn clean package fails

I looked through the other topics but apparently they got further than I did.

I’m seeing the following errors when running mvn clean package on the project root folder after making all the required steps to add a new language:

[ERROR] Project 'org.languagetool:language-en:5.1-SNAPSHOT' is duplicated in the reactor @
[ERROR] Project 'org.languagetool:language-en:5.1-SNAPSHOT' is duplicated in the reactor -> [Help 1]

Running with -X for debug:

Exception in thread "main" java.lang.InternalError: a fault occurred in an unsafe memory access operation
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
	at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:514)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:422)
	at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:416)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:415)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:425)
	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
	at org.eclipse.sisu.plexus.PlexusAnnotatedBeanModule.<init>(PlexusAnnotatedBeanModule.java:82)
	at org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:202)
	at org.apache.maven.cli.MavenCli.container(MavenCli.java:636)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:282)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)

I don’t have maven installed on my machine, I’m running it through docker, it didn’t fail on the first mvn command at the beginning of the guide.

Thank you!

Is your code available in a public repo to look at?

Yes @dnaber ! Sorry for the late response:

Thank you!

You need to change <artifactId>language-en</artifactId> in he/pom.xml to <artifactId>language-he</artifactId> (and adapt the <name>, too).

I’m now running into a new error (git updated, I accidentally included the error files).

These are the errors:

Thanks!

Have you tried several times, does it always happen? If so, could you try with JDK 8?

Yup, several time, since I don’t want to deal with Java and Maven installation I used docker from here:
https://hub.docker.com/_/maven

First latest (openjdk-14 which didn’t work) and then 3-jdk-8 (still doesn’t work) which is maven 3.6.3 and openjdk 8.

And an error log! Don’t you just love them? :slight_smile:

I suggest you try it outside of Docker. As the JVM crashes, this seems to be a rather low-level issue (not enough memory or so).

It was docker related but the problem was with the /tmp folder, I mapped it and used it for compilation, I switched to /opt and now it works:
https://confluence.atlassian.com/confkb/java-vm-dies-with-sigbus-0x7-when-temp-directory-is-full-on-linux-815584538.html

I’m currently struggling with the build, is there a way to build and test Hebrew only? It can really save me some time.

Use: ./build.sh he test

1 Like

Yet again…

[ERROR] /opt/languagetool-language-modules/he/src/main/java/org/languagetool/Hebrew.java:[77,10] invalid method declaration; return type required

My repo was updated.

I’m not sure I did the right thing with changing AmericanEnglish and AMERICAN_ENGLISH to some native terms but I had to change it otherwise it won’t compile anyway, I guess this replacement is wrong and I’m not sure what to do with it.

You use many English-specific imports, but the languages are independent in LT. So, he will not have access to any English class. You should clean up Hebrew.java first, getting rid of all English-specific stuff. Many methods like createDefaultDisambiguator() have default implementation and you don’t need them to get started.

I’ll do my best, is there any guide for that?
Can I simply remove the imports or should I also remove the relevant parts of the code?

I’ve created a pull request at simplified version of Hebrew.java by danielnaber · Pull Request #2 · yarons/languagetool · GitHub that provides a very simple Hebrew.java without any advanced features like tagging and chunking.

1 Like

Awesome!!! The build succeeded, what’s next?

I’m guessing that adding rules is not the first step.

BTW Is there any way we can use the rule editor or text analyzer to get our community more comfortable with adding rules?

Adding rules is the next step. Once there’s a process in place for that, one would probably want to have a spell checker, I guess?

As long as you don’t have a part-of-speech tagger anyway, you can maybe just use online tools with a different language, but write rules for Hebrew anyway.

1 Like