0

I am managing tomcat server behind the nginx. In tomcat multiple webapps are there. My OS is Ubuntu 18.04LTS on Digital Ocean.

Everything working fine, but suddenly I have one issue popped up. Tomcat is running fine, but webapps are not working ! And in server logs, it's showing about library missing, but it's a still exist over there.

So, anybody suggest me what's issue ?

or someone please suggest me the perfect/production level server.xml and tomcat8.service config file.

server.xml - one of virtual webapps

  <Service name="tm_xxx">
    <Connector port="7072" maxHttpHeaderSize="7192"
        maxThreads="1000" minSpareThreads="45" maxSpareThreads="100"
        enableLookups="false" redirectPort="9443" acceptCount="100"
        connectionTimeout="20000" disableUploadTimeout="true" />
        <Connector port="7172"
        enableLookups="false" redirectPort="9043" protocol="AJP/1.3" />

    <Engine name="tm_LB2" defaultHost="localhost">
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
            resourceName="UserDatabase"/>
            <Host name="localhost" appBase="tm_xxx"
                unpackWARs="true" autoDeploy="true"
                xmlValidation="false" xmlNamespaceAware="false">
                <Valve className="org.apache.catalina.valves.ErrorReportValve"
                    showReport="false"
                    showServerInfo="false" />
            </Host>
    </Engine>
</Service>
                                                                                   

tomcat8.service

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/tomcat8
Description=LSB: Start Tomcat.
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
After=remote-fs.target
After=network-online.target
After=nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
Restart=always
RestartUSec=50ms
TimeoutStartSec=1min
TimeoutStopSec=1min
TimeoutSec=1min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SuccessExitStatus=5 6
ExecStart=/etc/init.d/tomcat8 start
ExecStop=/etc/init.d/tomcat8 stop

SS for ERROR in catlina.out

enter image description here

PS: I have many times very bad experience over here(< 5000 reputational people). If you don't want to answer please leave. don't post answers like contact professional or like this. I have a issue so, after good research work I am posting my question here.

EDIT 1: One more thing I was forgot to mention before - I am deploying new things via gitlab runner, and then after just reloading webapps only. Not restarting tomcat service. For reloading webapps, I mention in context.xml file.

  • 2
    There is no way to have a general "perfect" config for everybody. Your config needs to be tailored to your workload, which is a long process of fine tuning one configuration parameter after another with a lot of benchmarking in between. Nobody but you can do that. If you have a specific issue, post your error message and your findings about it, and we can help you to try and solve it. – Gerald Schneider Dec 17 '20 at 06:14
  • @MichaelHampton -- Tomcat is running fine, but webapps are not working! And in server logs, it's showing about library missing, but it's a still exist over there. – shivang patel Dec 17 '20 at 06:38
  • Posting the image as a *code block* and adding the steps (you installed additional packages I guess) that lead to a previously working system makes this question easier to find & read for people that might have an answer. – anx Dec 17 '20 at 20:11

1 Answers1

1

During application startup Tomcat scans all the *.jar files in $CATALINA_HOME/lib (/usr/share/tomcat8/lib on Debianoids), $CATALINA_BASE/lib (usually /var/lib/tomcat8/lib if you have only one Tomcat running) and in the per-application WEB-INF/lib folders.

Your logs indicate that you have some jar files in /var/lib/tomcat8/lib/lib (sic!) that can be listed, but cannot be opened. My guess is: those are some dangling symbolic links, which you inadvertedly added during the installation.

Note: With the exception of some JDBC drivers and similar, your application don't need any files in $CATALINA_BASE/lib.

Piotr P. Karwasz
  • 5,292
  • 2
  • 9
  • 20