How to install and configure Tomcat in Plesk

Follow

Comments

10 comments

  • Avatar
    Marco Marsala

    Add guide to address common errors like this:

    ....
    Setting up tomcat8 (8.0.32-1ubuntu1.5) ...

    Creating config file /etc/default/tomcat8 with new version
    Adding system user `tomcat8' (UID 118) ...
    Adding new user `tomcat8' (UID 118) with group `tomcat8' ...
    Not creating home directory `/usr/share/tomcat8'.

    Creating config file /etc/logrotate.d/tomcat8 with new version
    Job for tomcat8.service failed because the control process exited with error code. See "systemctl status tomcat8.service" and "journalctl -xe" for details.
    invoke-rc.d: initscript tomcat8, action "start" failed.
    [0;1;31m*[0m tomcat8.service - LSB: Start Tomcat.
    Loaded: loaded (/etc/init.d/tomcat8; bad; vendor preset: enabled)
    Active: [0;1;31mfailed[0m (Result: exit-code) since Tue 2018-03-20 11:19:57 CET; 6ms ago
    Docs: man:systemd-sysv-generator(8)
    Process: 10686 ExecStart=/etc/init.d/tomcat8 start [0;1;31m(code=exited, status=1/FAILURE)[0m

    Mar 20 11:19:52 thenetworksolution.it systemd[1]: Starting LSB: Start Tomcat....
    Mar 20 11:19:52 thenetworksolution.it tomcat8[10686]: * Starting Tomcat serv...
    Mar 20 11:19:57 thenetworksolution.it tomcat8[10686]: ...fail!
    Mar 20 11:19:57 thenetworksolution.it systemd[1]: [0;1;39mtomcat8.service: Control pr...[0m
    Mar 20 11:19:57 thenetworksolution.it systemd[1]: [0;1;31mFailed to start LSB: Start ...[0m
    Mar 20 11:19:57 thenetworksolution.it systemd[1]: [0;1;39mtomcat8.service: Unit enter...[0m
    Mar 20 11:19:57 thenetworksolution.it systemd[1]: [0;1;39mtomcat8.service: Failed wit...[0m
    Hint: Some lines were ellipsized, use -l to show in full.
    dpkg: error processing package tomcat8 (--configure):
    subprocess installed post-installation script returned error exit status 1
    Setting up tomcat8-admin (8.0.32-1ubuntu1.5) ...
    Setting up tomcat8-examples (8.0.32-1ubuntu1.5) ...
    Setting up authbind (2.1.1+nmu1) ...
    dpkg: dependency problems prevent configuration of psa-tomcat-configurator:
    psa-tomcat-configurator depends on tomcat8; however:
    Package tomcat8 is not configured yet.

    dpkg: error processing package psa-tomcat-configurator (--configure):
    dependency problems - leaving unconfigured
    Processing triggers for systemd (229-4ubuntu21.1) ...
    No apport report written because the error message indicates its a followup error from a previous failure.
    Processing triggers for ureadahead (0.100.0-19) ...
    Errors were encountered while processing:
    tomcat8
    psa-tomcat-configurator
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    Bootstrapper has finished action (exec time: 0 sec.): parent_name='PLESK_17_5_3', sequence='pkgs', stage='rollback', sequence_order='1', operation='install', exec_cmd='rm -f /tmp/pp-bootstrapper-mode.flag; rm -f /var/lock/parallels-panel-maintenance-mode.flag; touch /var/lock/parallels-panel-upgrade-failure.flag; /etc/init.d/psa restart; :'', m_arch='', output: ~empty
    [2018-03-20 11:19:59.927130] Execute command /opt/psa/admin/bin/send-error-report install --version 17.5.3
    [2018-03-20 11:19:59.927750] Warning: Failed to attach to cgroup /sys/fs/cgroup/systemd/user/root/tasks, installer might be unexpectedly killed later by the system
    [2018-03-20 11:19:59.929214] Error: An error occurred on attempt to install packages.
    Attention! Your software might be inoperable.
    Please contact product technical support.

  • Avatar
    Alexandr Tumanov

    Hello, according to the log, tomcat8 package was not properly configured due to some issues during the startup.

    Try to start it manually and check the status of the service, it may show the error.

    # service tomcat8 start
    # service tomcat8 status

    Check journald logs for errors 

    # journalctl -xe

    When it is started, run 

    # dpkg -a --configure

    and rung Plesk installer again.

  • Avatar
    Marco Marsala (Edited )

    Running

    # service tomcat8 start

    gives

    Job for tomcat8.service failed because the control process exited with error code. See "systemctl status tomcat8.service" and "journalctl -xe" for details.

    Running

    # service tomcat8 status

    gives

    ● tomcat8.service - LSB: Start Tomcat.
    Loaded: loaded (/etc/init.d/tomcat8; bad; vendor preset: enabled)
    Active: failed (Result: exit-code) since Thu 2018-03-22 10:56:28 CET; 1min 50s ago
    Docs: man:systemd-sysv-generator(8)
    Process: 26985 ExecStart=/etc/init.d/tomcat8 start (code=exited, status=1/FAILURE)

    Mar 22 10:56:23 thenetworksolution.it systemd[1]: Starting LSB: Start Tomcat....
    Mar 22 10:56:23 thenetworksolution.it tomcat8[26985]: * Starting Tomcat servlet engine tomcat8
    Mar 22 10:56:28 thenetworksolution.it tomcat8[26985]: ...fail!
    Mar 22 10:56:28 thenetworksolution.it systemd[1]: tomcat8.service: Control process exited, code=exited status=1
    Mar 22 10:56:28 thenetworksolution.it systemd[1]: Failed to start LSB: Start Tomcat..
    Mar 22 10:56:28 thenetworksolution.it systemd[1]: tomcat8.service: Unit entered failed state.
    Mar 22 10:56:28 thenetworksolution.it systemd[1]: tomcat8.service: Failed with result 'exit-code'.

    Running

    # journalctl -xe

    gives no errors related to tomcat.

    Running

    # dpkg -a --configure

    gives

    Setting up tomcat8 (8.0.32-1ubuntu1.5) ...
    Job for tomcat8.service failed because the control process exited with error code. See "systemctl status tomcat8.service" and "journalctl -xe" for details.
    invoke-rc.d: initscript tomcat8, action "start" failed.
    ● tomcat8.service - LSB: Start Tomcat.
    Loaded: loaded (/etc/init.d/tomcat8; bad; vendor preset: enabled)
    Active: failed (Result: exit-code) since Thu 2018-03-22 11:00:54 CET; 5ms ago
    Docs: man:systemd-sysv-generator(8)
    Process: 27820 ExecStart=/etc/init.d/tomcat8 start (code=exited, status=1/FAILURE)

    Mar 22 11:00:49 thenetworksolution.it systemd[1]: Starting LSB: Start Tomcat....
    Mar 22 11:00:49 thenetworksolution.it tomcat8[27820]: * Starting Tomcat servlet engine tomcat8
    Mar 22 11:00:54 thenetworksolution.it tomcat8[27820]: ...fail!
    Mar 22 11:00:54 thenetworksolution.it systemd[1]: tomcat8.service: Control process exited, code=exited status=1
    Mar 22 11:00:54 thenetworksolution.it systemd[1]: Failed to start LSB: Start Tomcat..
    Mar 22 11:00:54 thenetworksolution.it systemd[1]: tomcat8.service: Unit entered failed state.
    Mar 22 11:00:54 thenetworksolution.it systemd[1]: tomcat8.service: Failed with result 'exit-code'.
    dpkg: error processing package tomcat8 (--configure):
    subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of psa-tomcat-configurator:
    psa-tomcat-configurator depends on tomcat8; however:
    Package tomcat8 is not configured yet.

    dpkg: error processing package psa-tomcat-configurator (--configure):
    dependency problems - leaving unconfigured
    Errors were encountered while processing:
    tomcat8
    psa-tomcat-configurator

  • Avatar
    Marco Marsala (Edited )

    Cannot edit anymore the above post due to Javascript errors in this website (please fix), so I add the rest here:

    When login to Plesk, the UI proposes to run the repair. I clicked the proposed link to do such repair but in the middle it displayed a SQLHYSTATE error (I cannot find it in any log file so I cannot paste it here). However the repair seems completed successfully and all services are running fine.

    I retried Tomcat installation with Plesk Installer, but it shows the component as already installed. Trying to start tomcat8 now gives same errors already listed above.

    So, I tried to remove tomcat with the Plesk Installer but still getting errors:

    [2018-03-22 11:18:41.133666] Installation started in background
    [2018-03-22 11:18:41.133724]
    Getting bootstrapper packages to installation list:
    [2018-03-22 11:18:41.133757] Following bootstrapper packages will be installed: (empty)
    [2018-03-22 11:18:41.133775] ----------------
    [2018-03-22 11:18:41.133789] Getting packages to installation list:
    [2018-03-22 11:18:41.133830] Following packages will be installed: dummy_obsoleter_psa-tomcat-configurator-0.0
    [2018-03-22 11:18:41.133849] ----------------
    [2018-03-22 11:18:41.133886] Checking whether the package dependencies are resolved.
    [2018-03-22 11:18:41.133916] autoinstaller: read output of DEBIAN_FRONTEND=noninteractive LANG=C apt-get --assume-yes --show-upgraded --purge --no-reinstall -o APT::Get::List-Cleanup=true -o Dpkg::options::=--force-confdef -o Dpkg::options::=--force-confold -o APT::Get::AllowUnauthenticated=false -o Acquire::Retries=3 -t 'xenial*' --just-print install psa-tomcat-configurator-
    [2018-03-22 11:18:41.859477] add to remove list dummy_obsoleter_psa-tomcat-configurator-0.0
    [2018-03-22 11:18:41.859580] add to install list tomcat8-8.0.32-1ubuntu1.5
    [2018-03-22 11:18:41.979035] Check package set before installation
    [2018-03-22 11:18:41.979338] The following packages from not selected components will be installed because they are required by other components' packages you selected for installation:
    [2018-03-22 11:18:41.987980] Installing packages
    [2018-03-22 11:18:41.993827] Bootstrapper has finished action (exec time: 0 sec.): parent_name='PLESK_17_5_3', sequence='prep', stage='execute', sequence_order='-1', operation='install', exec_cmd='touch /tmp/pp-bootstrapper-mode.flag; touch /var/lock/parallels-panel-maintenance-mode.flag; rm -f /var/lock/parallels-panel-upgrade-failure.flag; :'', m_arch='', output: ~empty
    [2018-03-22 11:18:42.004072] Reading package lists...
    Building dependency tree...
    Reading state information...
    tomcat8 is already the newest version (8.0.32-1ubuntu1.5).
    The following packages will be REMOVED:
    psa-tomcat-configurator*
    0 upgraded, 0 newly installed, 1 to remove and 175 not upgraded.
    2 not fully installed or removed.
    After this operation, 63.5 kB disk space will be freed.
    (Reading database ... (Reading database ... 5%(Reading database ... 10%(Reading database ... 15%(Reading database ... 20%(Reading database ... 25%(Reading database ... 30%(Reading database ... 35%(Reading database ... 40%(Reading database ... 45%(Reading database ... 50%(Reading database ... 55%(Reading database ... 60%(Reading database ... 65%(Reading database ... 70%(Reading database ... 75%(Reading database ... 80%(Reading database ... 85%(Reading database ... 90%(Reading database ... 95%(Reading database ... 100%(Reading database ... 247712 files and directories currently installed.)
    Removing psa-tomcat-configurator (17.5.3-ubuntu16.04.build1705170314.14) ...
    Setting up tomcat8 (8.0.32-1ubuntu1.5) ...
    Job for tomcat8.service failed because the control process exited with error code. See "systemctl status tomcat8.service" and "journalctl -xe" for details.
    invoke-rc.d: initscript tomcat8, action "start" failed.
    [0;1;31m*[0m tomcat8.service - LSB: Start Tomcat.
    Loaded: loaded (/etc/init.d/tomcat8; bad; vendor preset: enabled)
    Active: [0;1;31mfailed[0m (Result: exit-code) since Thu 2018-03-22 11:18:51 CET; 6ms ago
    Docs: man:systemd-sysv-generator(8)
    Process: 17681 ExecStart=/etc/init.d/tomcat8 start [0;1;31m(code=exited, status=1/FAILURE)[0m

    Mar 22 11:18:46 thenetworksolution.it systemd[1]: Starting LSB: Start Tomcat....
    Mar 22 11:18:46 thenetworksolution.it tomcat8[17681]: * Starting Tomcat serv...
    Mar 22 11:18:51 thenetworksolution.it tomcat8[17681]: ...fail!
    Mar 22 11:18:51 thenetworksolution.it systemd[1]: [0;1;39mtomcat8.service: Control pr...[0m
    Mar 22 11:18:51 thenetworksolution.it systemd[1]: [0;1;31mFailed to start LSB: Start ...[0m
    Mar 22 11:18:51 thenetworksolution.it systemd[1]: [0;1;39mtomcat8.service: Unit enter...[0m
    Mar 22 11:18:51 thenetworksolution.it systemd[1]: [0;1;39mtomcat8.service: Failed wit...[0m
    Hint: Some lines were ellipsized, use -l to show in full.
    dpkg: error processing package tomcat8 (--configure):
    subprocess installed post-installation script returned error exit status 1
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    Bootstrapper has finished action (exec time: 0 sec.): parent_name='PLESK_17_5_3', sequence='pkgs', stage='rollback', sequence_order='1', operation='install', exec_cmd='rm -f /tmp/pp-bootstrapper-mode.flag; rm -f /var/lock/parallels-panel-maintenance-mode.flag; touch /var/lock/parallels-panel-upgrade-failure.flag; /etc/init.d/psa restart; :'', m_arch='', output: ~empty
    [2018-03-22 11:18:53.954341] Execute command /opt/psa/admin/bin/send-error-report install --version 17.5.3
    [2018-03-22 11:18:53.955063] Warning: Failed to attach to cgroup /sys/fs/cgroup/systemd/user/root/tasks, installer might be unexpectedly killed later by the system
    [2018-03-22 11:18:53.956293] Error: An error occurred on attempt to install packages.
    Attention! Your software might be inoperable.
    Please contact product technical support.
  • Avatar
    Alexandr Tumanov

    @Marco, check /var/log/tomcat8/catalina.out for errors and try to solve them. Repeat the actions recommended above.

    Additionally, try to reinstall tomcat package manually(make sure that you don't have any required data on tomcat):

    # dpkg -P --force-all tomcat8
    # apt-get download tomcat8
    # dpkg -i tomcat8_8.0.32-1ubuntu1.5_all.deb

    Then run Plesk installer.

    If the issue persists - please create a ticket.

  • Avatar
    Marco Marsala (Edited )
     /var/log/tomcat8/catalina.out

    contains

    -Djava.endorsed.dirs=/usr/share/tomcat8/endorsed is not supported. Endorsed standards and standalone APIs
    in modular form will be supported via the concept of upgradeable modules.
    Error: Could not create the Java Virtual Machine.
    Error: A fatal exception has occurred. Program will exit.
    Running

    # dpkg -P --force-all tomcat8
    # apt-get download tomcat8
    # dpkg -i tomcat8_8.0.32-1ubuntu1.5_all.deb

    gives the same error.

  • Avatar
    Alexandr Tumanov

    @Marco, remove 

    /usr/share/tomcat8/endorsed

    it should not be there. Or rename 

    /usr/share/tomcat8/

    directory and reinstall tomcat8 by instruction above

  • Avatar
    Marco Marsala

    Such file is not here:

    # ls /usr/share/tomcat8/endorsed
    ls: cannot access '/usr/share/tomcat8/endorsed': No such file or directory
  • Avatar
    Alexandr Tumanov

    @Marco, if the issue is still actual, remove tomcat package as listed above, find all the folders and configs with name tomcat8 and rename them. Install tomcat8 again as listed above.

  • Avatar
    Marco Marsala

    @Alexandr I removed all folders and configs and verified with

    # find . -name tomcat

    but the installation still fails with the same error.

    # dpkg -P --force-all tomcat8
    (Reading database ... 247711 files and directories currently installed.)
    Removing tomcat8 (8.0.32-1ubuntu1.5) ...
    Purging configuration files for tomcat8 (8.0.32-1ubuntu1.5) ...
    Removing user `tomcat8' ...
    Warning: group `tomcat8' has no more members.
    Done.
    The group `tomcat8' does not exist.

    # apt-get download tomcat8

    # dpkg -i tomcat8_8.0.32-1ubuntu1.5_all.deb
    Selecting previously unselected package tomcat8.
    (Reading database ... 247677 files and directories currently installed.)
    Preparing to unpack tomcat8_8.0.32-1ubuntu1.5_all.deb ...
    Unpacking tomcat8 (8.0.32-1ubuntu1.5) ...
    Setting up tomcat8 (8.0.32-1ubuntu1.5) ...

    Creating config file /etc/default/tomcat8 with new version
    Adding system user `tomcat8' (UID 118) ...
    Adding new user `tomcat8' (UID 118) with group `tomcat8' ...
    Not creating home directory `/usr/share/tomcat8'.

    Creating config file /etc/logrotate.d/tomcat8 with new version
    Job for tomcat8.service failed because the control process exited with error code. See "systemctl status tomcat8.service" and "journalctl -xe" for details.
    invoke-rc.d: initscript tomcat8, action "start" failed.
    ● tomcat8.service - LSB: Start Tomcat.
    Loaded: loaded (/etc/init.d/tomcat8; bad; vendor preset: enabled)
    Active: failed (Result: exit-code) since Mon 2018-03-26 12:14:05 CEST; 3ms ago
    Docs: man:systemd-sysv-generator(8)
    Process: 1860 ExecStart=/etc/init.d/tomcat8 start (code=exited, status=1/FAILURE)

    Mar 26 12:14:05 thenetworksolution.it systemd[1]: Starting LSB: Start Tomcat....
    Mar 26 12:14:05 thenetworksolution.it tomcat8[1860]: * tomcat8 is not installed
    Mar 26 12:14:05 thenetworksolution.it systemd[1]: tomcat8.service: Control process exited, code=exited status=1
    Mar 26 12:14:05 thenetworksolution.it systemd[1]: Failed to start LSB: Start Tomcat..
    Mar 26 12:14:05 thenetworksolution.it systemd[1]: tomcat8.service: Unit entered failed state.
    Mar 26 12:14:05 thenetworksolution.it systemd[1]: tomcat8.service: Failed with result 'exit-code'.
    dpkg: error processing package tomcat8 (--install):
    subprocess installed post-installation script returned error exit status 1
    Processing triggers for systemd (229-4ubuntu21.1) ...
    Processing triggers for ureadahead (0.100.0-19) ...
    Errors were encountered while processing:
    tomcat8

    # journalctl -xe

    ar 26 12:14:54 thenetworksolution.it systemd[1]: Starting LSB: Start Tomcat....
    -- Subject: Unit tomcat8.service has begun start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit tomcat8.service has begun starting up.
    Mar 26 12:14:54 thenetworksolution.it tomcat8[1982]: * tomcat8 is not installed
    Mar 26 12:14:54 thenetworksolution.it systemd[1]: tomcat8.service: Control process exited, code=exited status=1
    Mar 26 12:14:54 thenetworksolution.it systemd[1]: Failed to start LSB: Start Tomcat..
    -- Subject: Unit tomcat8.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit tomcat8.service has failed.
    --
    -- The result is failed.
    Mar 26 12:14:54 thenetworksolution.it systemd[1]: tomcat8.service: Unit entered failed state.
    Mar 26 12:14:54 thenetworksolution.it systemd[1]: tomcat8.service: Failed with result 'exit-code'.

    # cat /var/log/tomcat8/catalina.out
    cat: /var/log/tomcat8/catalina.out: No such file or directory

Please sign in to leave a comment.

Have more questions? Submit a request