我知道這個問題已經被問到了很多,但我面臨一些問題。當我將 war 檔案上傳到 tomcat 時,我無法啟動並收到此錯誤
FAIL - Application at context path [/fuseki] could not be started
然後我嘗試刪除 tomcat 9,以便我可以安裝 tomcat 8,但我無法按照其他線程上給出的說明進行操作,因為當我運行
dpkg -l|grep tomcat
什麼也不返回。
sudo apt-get remove tomcat
回報
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'tomcat9' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 145 not upgraded.
root@ubuntu:~# sudo apt-get remove tomcat
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package tomcat
運行相同但使用 tomcat9 而不是僅僅 tomcat 返回
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'tomcat9' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 145 not upgraded.
然而,伺服器已啟動並正在運行,我可以透過瀏覽器連接到 UI,但無法啟動 war 檔案。
答案1
由於tomcat是透過將tar.gz檔案解壓縮到/opt/tomcat來安裝的,因此卸載過程將刪除/opt/tomcat。
cd /opt
sudo rm -rf tomcat