Tomcat8.5.73 Error: Could not find or load main class org.apache.catalina.startup.Bootstrap

首先我登录的是tomcat官网,选择source包下载,wget https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.83/bin/apache-tomcat-8.5.83.tar.gz

tar -xf  apache-tomcat-8.5.83.tar.gz

mv  aapache-tomcat-8.5.83.tar.gz /usr/local/tomcat

cd /usr/local/tomcat

执行./startup.sh

新建错误日志文件后

[root@localhost bin]# ./startup.sh
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:   
touch: cannot touch '/usr/local/tomcat/logs/catalina.out': No such file or directory
/usr/local/tomcat/bin/catalina.sh: line 504: /usr/local/tomcat/logs/catalina.out: No such file or directory

结果显示,启动正常

Using CATALINA_BASE: /mnt/tomcat
Using CATALINA_HOME: /mnt/tomcat
Using CATALINA_TMPDIR: /mnt/tomcat/temp
Using JRE_HOME: /usr/java/jdk1.8.0_77
Using CLASSPATH: /mnt/tomcat/bin/bootstrap.jar:/mnt/tomcat/bin/tomcat-juli.jar
Tomcat started.

但是用netstat -lntp|grep 8080会发现tomcat根本没有启动,查看 /mnt/tomcat/logs/catalina.out,报错:

Error: Could not find or load main class org.apache.catalina.startup.Bootstrap

我觉得非常奇怪,首先检查/mnt/tomcat/bin/bootstrap.jar确实不存在,然后 用find / -name bootstrap.jar在本地也找不到。那到底哪里导致的呢?

后面看了网上的帖子的才知道,原来tomcat官网中的source包是不完整的,logs文件夹跟bootstrap.jar一些重要的文件都没有的。正确的tomcat应该下载它的bin包

Tomcat8.5.73 Error: Could not find or load main class org.apache.catalina.startup.Bootstrap_第1张图片

特意把它写下来,省得大家浪费时间去检查日志什么的!

 

但是目前最新版本的8.5.73又无法找到下载bin的包,官网首页只有8.5.83的,开发又要求需要原始的8.5.73,于是复制了8.5.83的下载连接,通过上一层目录,找到8.5.73的目录,得到下载地址:

Tomcat8.5.73 Error: Could not find or load main class org.apache.catalina.startup.Bootstrap_第2张图片

看到bin包其实就是bin目录下的压缩包,于是找到8.5.73的下载链接地址:

https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.73/bin/apache-tomcat-8.5.73.tar.gz

通过下载wget https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.73/bin/apache-tomcat-8.5.73.tar.gz 后正常!

 

 

你可能感兴趣的:(运维生存,故障处理记录,1024程序员节)