我在我的$ CATALINA_HOME / lib /文件夹中添加了一个jar文件mysql-connector-java-5.1.34-bin.jar,所以我可以使用这个库来连接mysql的连接池。
我使用带有Cpanel的Centos 6.6 X64运行专用服务器。 我在/opt/jdk1.8.0_25中安装了jdk8并通过解压/ home / username /文件夹中的下载安装了tomcat 8。我按照本教程: http://tecadmin.net/install-tomcat-8-on-centos-rhel-and-ubuntu/
一个简单的" Hello World" servlet通过在public_html文件夹中部署.war文件来运行
但是现在当我在catalina.out文件中启动Tomcat(8.0.15)时,我看到了错误:
09-Dec-2014 17:45:49.152 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.15
09-Dec-2014 17:45:49.182 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /home/username/public_html/J.war
09-Dec-2014 17:45:49.592 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
09-Dec-2014 17:46:04.623 INFO [localhost-startStop-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [14,997] milliseconds.
09-Dec-2014 17:46:04.657 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /home/username/public_html/J.war has finished in 15,474 ms
连接池并不起作用。在我以前的服务器上,托管公司已经使用Cpanel设置了tomcat,这很好用。我没有更改servlet,因此也不会出现问题。
我的环境变量是:
CATALINA_HOME=/home/username/apache-tomcat-8.0.15
JRE_HOME=/opt/jdk1.8.0_25/jre
JAVA_PATH=/opt/jdk1.8.0_25/jre
PATH=/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr
/bin:/opt/jdk1.8.0_25/jre/bin:/opt/jdk1.8.0_25/bin:/usr/local/bin:/usr/X11R6/bin
:/root/bin:/opt/jdk1.8.0_25/bin
JAVA_HOME=/opt/jdk1.8.0_25
CLASSPATH=.:/usr/local/jdk/lib/classes.zip
最后一个CLASSPATH我不明白,因为服务器上没有文件classes.zip。
我还尝试直接在已部署的war文件的WEB-INF / lib文件夹中添加jar文件,但这也不起作用(尽管catalina.out中的错误已经消失)。
有人可以解释我在添加图书馆时遇到了什么问题吗?
由于