tomcat.service: main process exited, code=exited, status=127/n/a
by Sam2412 from LinuxQuestions.org on (#5QNKX)
Hi,
I am trying to start tomcat but it isn't starting
Code: tomcat.service - Apache Tomcat Web Application Container
Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2021-10-13 12:51:44 IST; 15s ago
Process: 23403 ExecStart=/usr/libexec/tomcat/server start (code=exited, status=127)
Main PID: 23403 (code=exited, status=127)
Oct 13 12:51:44 localhost.net systemd[1]: Started Apache Tomcat Web Application Container.
Oct 13 12:51:44 localhost.net systemd[1]: tomcat.service: main process exited, code=exited, status=127/n/a
Oct 13 12:51:44 localhost.net systemd[1]: Unit tomcat.service entered failed state.
Oct 13 12:51:44 localhost.net systemd[1]: tomcat.service failed.
i have checked the system logs
Oct 13 12:51:44 localhost.net server[23403]: Java virtual machine used: /usr/lib/jvm/jre/bin/java
Oct 13 12:51:44 localhost.net server[23403]: classpath used: /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:
Oct 13 12:51:44 localhost.net server[23403]: main class used: org.apache.catalina.startup.Bootstrap
Oct 13 12:51:44 localhost.net server[23403]: flags used: -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory
Oct 13 12:51:44 localhost.net server[23403]: options used: -Dcatalina.base=/usr/share/tomcat -Dcatalina.home=/usr/share/tomcat -Djava.e
Oct 13 12:51:44 localhost.net server[23403]: arguments used: start
Oct 13 12:51:44 localhost.net server[23403]: /usr/lib/jvm/jre/bin/java: error while loading shared libraries: libjli.so: cannot open sh
Oct 13 12:51:44 localhost.net systemd[1]: tomcat.service: main process exited, code=exited, status=127/n/a
Oct 13 12:51:44 localhost.net systemd[1]: Unit tomcat.service entered failed state.
Oct 13 12:51:44 localhost.net systemd[1]: tomcat.service failed.
[root@localhost ~]# locate libjli.so
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64/jre/lib/amd64/jli/libjli.so
[root@localhost ~]# java -version
openjdk version "11.0.12" 2021-07-20 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.12+7-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.12+7-LTS, mixed mode, sharing)
[root@localhost ~]# ldd /usr/lib/jvm/jre/bin/java
linux-vdso.so.1 => (0x00007ffd81f43000)
libz.so.1 => /lib64/libz.so.1 (0x00007fc085b54000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc085938000)
libjli.so => /usr/lib/jvm/jre/bin/../lib/jli/libjli.so (0x00007fc085727000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fc085523000)
libc.so.6 => /lib64/libc.so.6 (0x00007fc085155000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc085f6d000)
before this issue occured i did some changes
[root@localhost ~]# setcap cap_net_bind_service+ep /usr/lib/jvm/java-11-openjdk-11.0.12.0.7-0.el7_9.x86_64/
after that tomcat isn't running
How to solve this issue/?
I am trying to start tomcat but it isn't starting
Code: tomcat.service - Apache Tomcat Web Application Container
Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2021-10-13 12:51:44 IST; 15s ago
Process: 23403 ExecStart=/usr/libexec/tomcat/server start (code=exited, status=127)
Main PID: 23403 (code=exited, status=127)
Oct 13 12:51:44 localhost.net systemd[1]: Started Apache Tomcat Web Application Container.
Oct 13 12:51:44 localhost.net systemd[1]: tomcat.service: main process exited, code=exited, status=127/n/a
Oct 13 12:51:44 localhost.net systemd[1]: Unit tomcat.service entered failed state.
Oct 13 12:51:44 localhost.net systemd[1]: tomcat.service failed.
i have checked the system logs
Oct 13 12:51:44 localhost.net server[23403]: Java virtual machine used: /usr/lib/jvm/jre/bin/java
Oct 13 12:51:44 localhost.net server[23403]: classpath used: /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:
Oct 13 12:51:44 localhost.net server[23403]: main class used: org.apache.catalina.startup.Bootstrap
Oct 13 12:51:44 localhost.net server[23403]: flags used: -Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory
Oct 13 12:51:44 localhost.net server[23403]: options used: -Dcatalina.base=/usr/share/tomcat -Dcatalina.home=/usr/share/tomcat -Djava.e
Oct 13 12:51:44 localhost.net server[23403]: arguments used: start
Oct 13 12:51:44 localhost.net server[23403]: /usr/lib/jvm/jre/bin/java: error while loading shared libraries: libjli.so: cannot open sh
Oct 13 12:51:44 localhost.net systemd[1]: tomcat.service: main process exited, code=exited, status=127/n/a
Oct 13 12:51:44 localhost.net systemd[1]: Unit tomcat.service entered failed state.
Oct 13 12:51:44 localhost.net systemd[1]: tomcat.service failed.
[root@localhost ~]# locate libjli.so
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.302.b08-0.el7_9.x86_64/jre/lib/amd64/jli/libjli.so
[root@localhost ~]# java -version
openjdk version "11.0.12" 2021-07-20 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.12+7-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.12+7-LTS, mixed mode, sharing)
[root@localhost ~]# ldd /usr/lib/jvm/jre/bin/java
linux-vdso.so.1 => (0x00007ffd81f43000)
libz.so.1 => /lib64/libz.so.1 (0x00007fc085b54000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc085938000)
libjli.so => /usr/lib/jvm/jre/bin/../lib/jli/libjli.so (0x00007fc085727000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fc085523000)
libc.so.6 => /lib64/libc.so.6 (0x00007fc085155000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc085f6d000)
before this issue occured i did some changes
[root@localhost ~]# setcap cap_net_bind_service+ep /usr/lib/jvm/java-11-openjdk-11.0.12.0.7-0.el7_9.x86_64/
after that tomcat isn't running
How to solve this issue/?