jfinal项目启动时,oracle数据库报错!

xingjinlun 发布于 2012/09/24 10:13
阅读 2K+
收藏 0

@JFinal 你好,想跟你请教个问题:

jfinal项目启动时,报以下错误:


09:55:29,796 ERROR [STDERR] Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1"
09:55:29,796 ERROR [STDERR] java.lang.NoClassDefFoundError: Could not initialize class oracle.jdbc.driver.DMSFactory
09:55:29,796 ERROR [STDERR]  at oracle.jdbc.driver.PhysicalConnection.createDMSSensors(PhysicalConnection.java:3873)
09:55:29,796 ERROR [STDERR]  at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:642)
09:55:29,796 ERROR [STDERR]  at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:238)
09:55:29,796 ERROR [STDERR]  at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
09:55:29,796 ERROR [STDERR]  at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:567)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
09:55:29,796 ERROR [STDERR] Exception in thread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0"
09:55:29,796 ERROR [STDERR] java.lang.NoClassDefFoundError: oracle/dms/console/DMSConsole
09:55:29,796 ERROR [STDERR]  at oracle.jdbc.driver.DMSFactory.<clinit>(DMSFactory.java:51)
09:55:29,796 ERROR [STDERR]  at oracle.jdbc.driver.PhysicalConnection.createDMSSensors(PhysicalConnection.java:3873)
09:55:29,796 ERROR [STDERR]  at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:642)
09:55:29,796 ERROR [STDERR]  at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:238)
09:55:29,796 ERROR [STDERR]  at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
09:55:29,796 ERROR [STDERR]  at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:567)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
09:55:29,796 ERROR [STDERR]  at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
09:55:29,796 ERROR [STDERR] Caused by: java.lang.ClassNotFoundException: oracle.dms.console.DMSConsole from BaseClassLoader@12b304b{VFSClassLoaderPolicy@6f97cf{name=vfsfile:/D:/Program%20Files/jboss-5.1.0.GA/server/default/deploy/SynJFinal.war/ domain=ClassLoaderDomain@183e109{name=vfsfile:/D:/Program%20Files/jboss-5.1.0.GA/server/default/deploy/SynJFinal.war/ parentPolicy=AFTER_BUT_JAVA_BEFORE parent=ClassLoaderDomain@1263db{DefaultDomain}} roots=[MemoryContextHandler@5742980[path= context=vfsmemory://5c4o2c2s-h8jbnd-h7gxbucf-1-h7gxc51u-19 real=vfsmemory://5c4o2c2s-h8jbnd-h7gxbucf-1-h7gxc51u-19], FileHandler@19723987[path=SynJFinal.war/WEB-INF/classes context=file:/D:/Program%20Files/jboss-5.1.0.GA/server/default/deploy/ real=file:/D:/Program%20Files/jboss-5.1.0.GA/server/default/deploy/SynJFinal.war/WEB-INF/classes/], DelegatingHandler@16828278[path=SynJFinal.war/WEB-INF/lib/c3p0-0.9.1.2.jar context=file:/D:/Program%20Files/jboss-5.1.0.GA/server/default/deploy/ real=file:/D:/Program%20Files/jboss-5.1.0.GA/server/default/deploy/SynJFinal.war/WEB-INF/lib/c3p0-0.9.1.2.jar], DelegatingHandler@2561149[path=SynJFinal.war/WEB-INF/lib/jfinal-1.1.3-bin.jar context=file:/D:/Program%20Files/jboss-5.1.0.GA/server/default/deploy/ real=file:/D:/Program%20Files/jboss-5.1.0.GA/server/default/deploy/SynJFinal.war/WEB-INF/lib/jfinal-1.1.3-bin.jar], DelegatingHandler@28461256[path=SynJFinal.war/WEB-INF/lib/log4j-1.2.16.jar context=file:/D:/Program%20Files/jboss-5.1.0.GA/server/default/deploy/ real=file:/D:/Program%20Files/jboss-5.1.0.GA/server/default/deploy/SynJFinal.war/WEB-INF/lib/log4j-1.2.16.jar], DelegatingHandler@29909270[path=SynJFinal.war/WEB-INF/lib/oracle-jdbc6dms.jar context=file:/D:/Program%20Files/jboss-5.1.0.GA/server/default/deploy/ real=file:/D:/Program%20Files/jboss-5.1.0.GA/server/default/deploy/SynJFinal.war/WEB-INF/lib/oracle-jdbc6dms.jar]]  delegates=null exported=[, com.mchange.v2.cfg, com.mchange.v2.sql, com.mchange.v2.coalesce, com.jfinal.render, org.apache.log4j, com.mchange.v2.c3p0.subst, org.apache.log4j.lf5.config, org.apache.log4j.spi, com.mchange.v2.codegen.bean, oracle.jdbc.internal, com.mchange.v2.c3p0.mbean, com.jfinal.plugin.c3p0, org.apache.log4j.chainsaw, com.mchange.v2.c3p0.util, com.mchange.v2.log, com.jfinal.server, com.mchange.v1.db.sql, oracle.net.mesg, oracle.jdbc.xa.client, com.mchange.v2.c3p0.management, com.jfinal.ext.handler, org.apache.log4j.pattern, oracle.core.lmx, com.jfinal.util, oracle.net.ano, com.jfinal.plugin.spring, oracle.core.lvf, com.mchange.v2.sql.filter, com.mchange.v2.log.log4j, com.jfinal.plugin.activerecord.cache, com.mchange.v2.beans, oracle.jdbc.replay.internal, org.apache.log4j.lf5.util, com.jfinal.upload, org.apache.log4j.jdbc, com.mchange.v2.encounter, oracle.jdbc.pool, com.mchange.v1.db, oracle.jdbc.replay.driver, com.mchange.v2.util, org.apache.log4j.lf5, oracle.net.jndi, oracle.net.jdbc.nl, com.jfinal.core, com.jfinal.log, org.apache.log4j.lf5.viewer.images, com.jfinal.plugin.ehcache, com.mchange.v2.debug, com.mchange.v2.c3p0.jboss, oracle.jdbc.proxy.annotation, com.mchange.v2.async, com.jfinal.ext.render, com.mchange.v2.holders, com.mchange.v2.c3p0.cfg, com.mchange.v2.c3p0.filter, oracle.jdbc.util, META-INF.services, oracle.jdbc.rowset, com.jfinal.ext.interceptor, org.apache.log4j.varia, com.mchange.v2, oracle.jdbc, com.mchange.v1, org.apache.log4j.lf5.viewer.configure, oracle.jdbc.dcn, com.mchange.v2.cfg.junit, com.mchange.v1.identicator, oracle.sql.converter, oracle.security.o5logon, com.mchange.v2.c3p0, com.jfinal.plugin.activerecord, org.apache.log4j.nt, com.mchange.v2.lang, oracle.jdbc.replay, com.jfinal.validate, com.synway.common, com.jfinal.plugin, oracle.jdbc.connector, META-INF.maven.log4j.log4j, oracle.net.aso, org.apache.log4j.xml, oracle.jdbc.aq, oracle.sql, com.mchange.v2.io, com.mchange.lang, oracle.net.resolver, com.jfinal.plugin.activerecord.dialect, oracle.jdbc.xa, com.mchange.v2.ser, com.jfinal.aop, oracle.net.jdbc.nl.mesg, com.mchange.v2.c3p0.stmt, org.apache.log4j.lf5.viewer.categoryexplorer, com.mchange.v2.naming, org.apache.log4j.or, com.mchange.v2.management, oracle.jdbc.driver, com.mchange.v2.codegen, org.apache.log4j.net, org.apache.log4j.lf5.viewer, org.apache.log4j.jmx, org.apache.log4j.config, org.apache.log4j.helpers, com.mchange.v2.resourcepool, oracle.jpub.runtime, org.apache.log4j.or.jms, com.mchange, oracle.sql.converter_xcharset, oracle.net.nt, com.jfinal.i18n, oracle.net.ns, com.jfinal.config, com.mchange.v2.c3p0.impl, oracle.jdbc.oracore, com.jfinal.plugin.druid, com.mchange.util, oracle.jdbc.proxy, com.jfinal.handler, com.jfinal.plugin.activerecord.tx, com.mchange.v2.log.jdk14logging, com.mchange.v1.io, com.mchange.v1.util, com.jfinal.plugin.auth, org.apache.log4j.or.sax, oracle.net.jdbc.TNSAddress, META-INF, com.mchange.v1.lang, com.mchange.v2.codegen.intfc, com.jfinal.token, oracle.jdbc.oci, com.mchange.v1.xml, oracle.jdbc.diagnostics, oracle.security.o3logon] <IMPORT-ALL>NON_EMPTY}}
09:55:29,796 ERROR [STDERR]  at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
09:55:29,796 ERROR [STDERR]  at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
09:55:29,796 ERROR [STDERR]  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
09:55:29,796 ERROR [STDERR]  ... 14 more

以下是项目结构目录:

以下是demoConfig.java

/**
  * 配置常量
  */
 public void configConstant(Constants me) {
  loadPropertyFile("db.properties");            // 加载少量必要配置,随后可用getProperty(...)获取值
  me.setDevMode(getPropertyToBoolean("devMode", false));
  me.setViewType(ViewType.JSP);        // 设置视图类型为Jsp,否则默认为FreeMarker
 }
 
 /**
  * 配置路由
  */
 public void configRoute(Routes me) {
  me.add("/login", CommonController.class);
 }
 
 /**
  * 配置插件
  */
 public void configPlugin(Plugins me) {
  // 配置C3p0数据库连接池插件
  C3p0Plugin c3p0Plugin = new C3p0Plugin(getProperty("url"), getProperty("username"), getProperty("password"));
  c3p0Plugin.setDriverClass("oracle.jdbc.OracleDriver");
  me.add(c3p0Plugin);
  
  // 配置ActiveRecord插件
  ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0Plugin);
  me.add(arp);
  arp.addMapping("manex", "id", User.class); // 映射manex 表到 User模型
 }
 
 /**
  * 配置全局拦截器
  */
 public void configInterceptor(Interceptors me) {
 }
 
 /**
  * 配置处理器
  */
 public void configHandler(Handlers me) {
 }

以下是配置文件db.properties:

url = jdbc:oracle:thin:@10.1.1.33:1521:AAA
username = bbb
password = bbb
devMode = true

请问是什么原因导致的,oracle-jdbc6dms.jar已放入WEB-INF/lib下,谢谢!

加载中
1
loyal
loyal
没有指定oracle方言.我第一次用的时候也像你这样,呵呵....仔细看文档哦!@
0
JFinal
JFinal
除了 @loyal 说的没有指定方言问题以外,可能还有另一个问题:oracle 驱动版本与你的oracle 库不匹配,如果加上方言仍有异常,可以替换下驱动 :)
0
xingjinlun
xingjinlun
感谢两位大侠,问题已解决,正如@JFinal说的,有两个原因导致。主要是我文档没看仔细:)
0
JFinal
JFinal

引用来自“xingjinlun”的答案

感谢两位大侠,问题已解决,正如@JFinal说的,有两个原因导致。主要是我文档没看仔细:)
谢谢关注 JFinal , 欢迎常来提建议 
返回顶部
顶部