在服务器错误中运行.jar应用程序

时间:2013-03-01 22:50:35

标签: java jar

我尝试在centos5上的tomcat6中部署应用程序,但问题是应用程序无法启动 我有一个登录“usr / local / tomcat / logs / catalina.out” 关于启动应用程序的最后几行是

Mar 1, 2013 10:24:54 PM org.apache.catalina.core.NamingContextListener
addResource
WARNING: Failed to register in JMX: javax.naming.NamingException:
Could not load resource factory class [Root exception is
java.lang.ClassNotFoundException:
org.apache.tomcat.jdbc.pool.DataSourceFactory]
Mar 1, 2013 10:24:54 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Mar 1, 2013 10:24:54 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [] startup failed due to previous errors

2 个答案:

答案 0 :(得分:0)

我用Google搜索了

Root exception is java.lang.ClassNotFoundException:
org.apache.tomcat.jdbc.pool.DataSourceFactory

得到了这个,听起来很有希望:java.lang.ClassNotFoundException: org.apache.tomcat.jdbc.pool DataSourceFactory

答案 1 :(得分:0)

验证tomcat安装文件夹中是否有包含该文件的lib文件夹 Tomcat的dbcp.jar

在context.xml文件中你应该有这样的东西:

<Context path="/YourApp"> 
 <Resource username="dbUser" url="jdbc:mysql://localhost:3306/dbName" 
     type="javax.sql.DataSource" removeAbandonedTimeout="120" removeAbandoned="true" 
     password="******" name="jdbc/dbName" 
     driverClassName="com.mysql.jdbc.Driver" autoReconnect="true" auth="Container"/> 
 </Context>