直接上Tomcat启动错误详细信息,如下:
localhost:/home/hxstrive/apache-tomcat-7.0.42_64 # ./bin/startup.sh ; tail -f logs/catalina.out Using CATALINA_BASE: /home/hxstrive/apache-tomcat-7.0.42_64 Using CATALINA_HOME: /home/hxstrive/apache-tomcat-7.0.42_64 Using CATALINA_TMPDIR: /home/hxstrive/apache-tomcat-7.0.42_64/temp Using JRE_HOME: /home/hxstrive/jdk1.8.0_161 Using CLASSPATH: /home/hxstrive/apache-tomcat-7.0.42_64/bin/bootstrap.jar:/home/hxstrive/apache-tomcat-7.0.42_64/bin/tomcat-juli.jar at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1377) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431) at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:1888) Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=256m; support was removed in 8.0 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 Error opening zip file or JAR manifest missing : ../lib/spring-agent-2.5.6.jar Error occurred during initialization of VM agent library failed to init: instrument Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=256m; support was removed in 8.0 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 Error opening zip file or JAR manifest missing : ../lib/spring-agent-2.5.6.jar Error occurred during initialization of VM agent library failed to init: instrument
修改 catalina.sh 脚本,将 JAVA_OPTS 后面指定的 -javaagent 的 jar 包地址改为绝对地址。如下:
(1)修改前,-javaagent 后面使用的是相对地址
# ----- Execute The Requested Command ----------------------------------------- CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" JAVA_OPTS="-javaagent:../lib/spring-agent-2.5.6.jar $JAVA_OPTS -server -Xms512m -Xmx1024m -Xss1024K -XX:PermSize=256m -XX:MaxPermSize=512m" # Bugzilla 37848: only output this if we have a TTY
(2)修改后,将 -javaagent 后面指定的 jar 改为绝对地址
# ----- Execute The Requested Command ----------------------------------------- CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" JAVA_OPTS="-javaagent:$CATALINA_BASE/lib/spring-agent-2.5.6.jar $JAVA_OPTS -server -Xms512m -Xmx1024m -Xss1024K -XX:PermSize=256m -XX:MaxPermSize=512m" # Bugzilla 37848: only output this if we have a TTY