Hi Thomas and Petter,
I built the nikita-noark5-core-0.7.jar file from gitlab.com/OsloMet-ABI/nikita-noark5-core http://Gitlab.com/OsloMet-ABI/nikita-noark5-core with
ole@intelligence:~/noark/nikita-noark5-core$ mvn install
[...]
[INFO] --- install:3.1.1:install (default-install) @ nikita-noark5-core --- [INFO] Installing /home/ole/noark/nikita-noark5-core/pom.xml to /home/ole/.m2/repository/nikita/nikita-noark5-core/0.7/nikita-noark5-core-0.7.pom [INFO] Installing /home/ole/noark/nikita-noark5-core/target/nikita-noark5-core-0.7.jar to /home/ole/.m2/repository/nikita/nikita-noark5-core/0.7/nikita-noark5-core-0.7.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 35.791 s [INFO] Finished at: 2025-01-14T05:58:55+01:00 [INFO] ------------------------------------------------------------------------
When I try to invoke it, I find that the main class app.N5CoreApp won't initialize.
ole@intelligence:~/noark/nikita-noark5-core$ /usr/bin/java -jar /var/nikita-noark5-core/nikita-noark5-core-0.7.jar Error: Unable to initialize main class app.N5CoreApp Caused by: java.lang.NoClassDefFoundError: org/springframework/core/env/Environment ole@intelligence:~/noark/nikita-noark5-core$ /usr/bin/java -jar /var/nikita-noark5-core/nikita-noark5-core-0.7.ja
I used the org.codehaus.mojo rpm-maven-plugin to build the RPM file.
See attached patch.
To build the RPM package, invoke
ole@intelligence:~/noark/nikita-noark5-core$ mvn rpm:rpm [INFO] Scanning for projects... [INFO] [INFO] ---------------------< nikita:nikita-noark5-core >---------------------- [INFO] Building nikita-noark5-core 0.7 [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- rpm:2.3.0:rpm (default-cli) @ nikita-noark5-core --- [INFO] Directory /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/BUILD already exists. Deleting all contents. [INFO] Directory /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/RPMS already exists. Deleting all contents. [INFO] Directory /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/SOURCES already exists. Deleting all contents. [INFO] Directory /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/SPECS already exists. Deleting all contents. [INFO] Directory /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/SRPMS already exists. Deleting all contents. [INFO] Directory /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/tmp-buildroot already exists. Deleting all contents. [INFO] Directory /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/buildroot already exists. Deleting all contents. [INFO] Copying files to /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/tmp-buildroot/var/nikita-noark5-core [INFO] Copying files to /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/tmp-buildroot/etc/systemd/system [INFO] Creating spec file /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/SPECS/nikita-noark5-core.spec [INFO] Building target platforms: noarch-redhat-linux [INFO] Building for target noarch-redhat-linux [INFO] warning: %source_date_epoch_from_changelog is set, but %changelog has no entries to take a date from [INFO] Executing(%mkbuilddir): /bin/sh -e /var/tmp/rpm-tmp.cxyEum [INFO] + umask 022 [INFO] + cd /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/BUILD/nikita-noark5-core-0.7-build [INFO] + test -d /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/BUILD/nikita-noark5-core-0.7-build [INFO] + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/BUILD/nikita-noark5-core-0.7-build [INFO] + /usr/bin/rm -rf /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/BUILD/nikita-noark5-core-0.7-build [INFO] + /usr/bin/mkdir -p /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/BUILD/nikita-noark5-core-0.7-build [INFO] + /usr/bin/mkdir -p /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/BUILD/nikita-noark5-core-0.7-build/SPECPARTS [INFO] + RPM_EC=0 [INFO] ++ jobs -p [INFO] + exit 0 [INFO] Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.RizH4R [INFO] + umask 022 [INFO] + cd /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/BUILD/nikita-noark5-core-0.7-build [INFO] + '[' /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/buildroot '!=' / ']' [INFO] + rm -rf /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/buildroot [INFO] ++ dirname /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/buildroot [INFO] + mkdir -p /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core [INFO] + mkdir /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/buildroot [INFO] + CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' [INFO] + export CFLAGS [INFO] + CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' [INFO] + export CXXFLAGS [INFO] + FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib/gfortran/modules ' [INFO] + export FFLAGS [INFO] + FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib/gfortran/modules ' [INFO] + export FCFLAGS [INFO] + VALAFLAGS=-g [INFO] + export VALAFLAGS [INFO] + RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes --cap-lints=warn' [INFO] + export RUSTFLAGS [INFO] + LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -Wl,--build-id=sha1 ' [INFO] + export LDFLAGS [INFO] + LT_SYS_LIBRARY_PATH=/usr/lib: [INFO] + export LT_SYS_LIBRARY_PATH [INFO] + CC=gcc [INFO] + export CC [INFO] + CXX=g++ [INFO] + export CXX [INFO] + '[' -d /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/buildroot ']' [INFO] + mv /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/tmp-buildroot/etc /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/tmp-buildroot/var /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/buildroot [INFO] + /usr/lib/rpm/check-buildroot [INFO] + /usr/lib/rpm/redhat/brp-ldconfig [INFO] + /usr/lib/rpm/brp-compress [INFO] + /usr/lib/rpm/brp-strip /usr/bin/strip [INFO] + /usr/lib/rpm/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump [INFO] + /usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip [INFO] + /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip [INFO] + /usr/lib/rpm/check-rpaths [INFO] + /usr/lib/rpm/redhat/brp-mangle-shebangs [INFO] + /usr/lib/rpm/brp-remove-la-files [INFO] + env /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 -j12 [INFO] + /usr/lib/rpm/redhat/brp-python-hardlink [INFO] + /usr/bin/add-determinism --brp -j12 /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/buildroot [INFO] Handler jar skipped: jar handler requires $SOURCE_DATE_EPOCH to be set [INFO] Handler zip skipped: zip handler requires $SOURCE_DATE_EPOCH to be set [INFO] Scanned 6 directories and 2 files, [INFO] processed 0 inodes, [INFO] 0 modified (0 replaced + 0 rewritten), [INFO] 0 unsupported format, 0 errors [INFO] Processing files: nikita-noark5-core-0.7-1.noarch [INFO] Provides: nikita-noark5-core = 0.7-1 [INFO] Requires(interp): /bin/sh /bin/sh [INFO] Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 [INFO] Requires(pre): /bin/sh [INFO] Requires(post): /bin/sh [INFO] Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/buildroot [INFO] Wrote: /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/RPMS/noarch/nikita-noark5-core-0.7-1.noarch.rpm [INFO] Executing(rmbuild): /bin/sh -e /var/tmp/rpm-tmp.PLmWwE [INFO] + umask 022 [INFO] + cd /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/BUILD/nikita-noark5-core-0.7-build [INFO] + test -d /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/BUILD/nikita-noark5-core-0.7-build [INFO] + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/BUILD/nikita-noark5-core-0.7-build [INFO] + rm -rf /home/ole/noark/nikita-noark5-core/target/rpm/nikita-noark5-core/BUILD/nikita-noark5-core-0.7-build [INFO] + RPM_EC=0 [INFO] ++ jobs -p [INFO] + exit 0 [INFO] %source_date_epoch_from_changelog is set, but %changelog has no entries to take a date from [INFO] [INFO] RPM build warnings: [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.224 s [INFO] Finished at: 2025-01-14T06:04:57+01:00 [INFO] ------------------------------------------------------------------------
Install the RPM package on the local Fedora Core installation with
ole@intelligence:~/noark/nikita-noark5-core$ sudo rpm -Uvh target/rpm/nikita-noark5-core/RPMS/noarch/nikita-noark5-core-0.7-1.noarch.rpm Verifying... ################################# [100%] Preparing... ################################# [100%] Updating / installing... 1:nikita-noark5-core-0.7-1 ################################# [100%]
ole@intelligence:~/noark/nikita-noark5-core$ sudo service nikita-noark5-core start Redirecting to /bin/systemctl start nikita-noark5-core.service ole@intelligence:~/noark/nikita-noark5-core$ sudo service nikita-noark5-core status Redirecting to /bin/systemctl status nikita-noark5-core.service × nikita-noark5-core.service - Nikita Noark5 Core Application Loaded: loaded (/etc/systemd/system/nikita-noark5-core.service; enabled; preset: disabled) Drop-In: /usr/lib/systemd/system/service.d └─10-timeout-abort.conf, 50-keep-warm.conf Active: failed (Result: exit-code) since Tue 2025-01-14 06:07:03 CET; 2s ago Duration: 18ms Invocation: 7c8c3f56d53c4e36b55bb256d496ed55 Process: 118176 ExecStart=/usr/bin/java -jar /var/nikita-noark5-core/nikita-noark5-core.jar (code=exited, status=1/FAILURE) Main PID: 118176 (code=exited, status=1/FAILURE)
Jan 14 06:07:03 intelligence.aamot.io systemd[1]: nikita-noark5-core.service: Scheduled restart job, restart counter is at 5. Jan 14 06:07:03 intelligence.aamot.io systemd[1]: nikita-noark5-core.service: Start request repeated too quickly. Jan 14 06:07:03 intelligence.aamot.io systemd[1]: nikita-noark5-core.service: Failed with result 'exit-code'. Jan 14 06:07:03 intelligence.aamot.io systemd[1]: Failed to start nikita-noark5-core.service - Nikita Noark5 Core Application.
As you can see, nikita-noark5-core fails to boot as a systemd service with the executable parameter in /etc/systemd/system/nikita-noark5-core.service
ole@intelligence:~/noark/nikita-noark5-core$ cat /etc/systemd/system/nikita-noark5-core.service [Unit] Description=Nikita Noark5 Core Application After=network.target
[Service] Type=simple ExecStart=/usr/bin/java -jar /var/nikita-noark5-core/nikita-noark5-core.jar Restart=on-failure User=root Group=root SuccessExitStatus=143
[Install] WantedBy=multi-user.target
ExecStart=/usr/bin/java -jar /var/nikita-noark5-core/nikita-noark5-core.jar
after the RPM package has been installed and is ready to launch Nikita as a systemd service on boot.
Any advice or tips?
Best, Ole