nutz oracle配置,关于Nutz无法连接oracle的问题

大家好,我参考Nutz-book项目之后想要把数据库从**mysql**改为**oracle**,但是项目启动不起来,提示*ERROR - dataSource init error*

我的**dao.js里面的部分内容**为:

dataSource : {

type : "com.alibaba.druid.pool.DruidDataSource",

events : {

create : "init",

depose : 'close'

},

fields : {

url : {java:"$conf.get('db.url')"},

username : {java:"$conf.get('db.username')"},

password : {java:"$conf.get('db.password')"},

testWhileIdle : true,

validationQuery : {java:"$conf.get('db.validationQuery')"},

maxActive : {java:"$conf.get('db.maxActive')"},

filters : "mergeStat",

connectionProperties : "druid.stat.slowSqlMillis=2000"

}

}

db的配置文件:

db.url=jdbc:oracle:thin:@192.168.140.149:1521:MyDatabase

db.username=Account

db.password=123456

db.validationQuery=select 1

db.maxActive=100

一部分错误提示:

2015-11-02 16:38:31,350 com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:660) ERROR - dataSource init error

java.sql.SQLException: oracle.jdbc.driver.OracleDriver

at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:528)

at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:597)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.nutz.ioc.trigger.MethodEventTrigger.trigger(MethodEventTrigger.java:18)

at org.nutz.ioc.weaver.DefaultWeaver.onCreate(DefaultWeaver.java:74)

at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:135)

at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:196)

at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)

at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:73)

at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:196)

at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:221)

at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:140)

at iie.wxcj.MainSetup.init(MainSetup.java:35)

at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:270)

at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:119)

at org.nutz.mvc.ActionHandler.(ActionHandler.java:19)

at org.nutz.mvc.NutFilter.init(NutFilter.java:77)

at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)

at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)

at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:107)

at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)

at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:191)

at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:526)

... 35 more

2015-11-02 16:38:31,354 com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:669) INFO - {dataSource-1} inited

2015-11-02 16:38:31,354 org.nutz.ioc.impl.ScopeContext.remove(ScopeContext.java:79) DEBUG - Remove object 'dataSource' from [app]

2015-11-02 16:38:31,355 org.nutz.ioc.impl.ScopeContext.remove(ScopeContext.java:79) DEBUG - Remove object 'dao' from [app]

2015-11-02 16:38:31,355 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:123) ERROR - Error happend during start serivce!

org.nutz.ioc.IocException: java.sql.SQLException: oracle.jdbc.driver.OracleDriver FAIL to create Ioc Bean name=[dataSource]

beacase [java.sql.SQLException: oracle.jdbc.driver.OracleDriver] FAIL to create Ioc Bean name=[dao]

beacase [java.sql.SQLException: oracle.jdbc.driver.OracleDriver FAIL to create Ioc Bean name=[dataSource]

beacase [java.sql.SQLException: oracle.jdbc.driver.OracleDriver]]

at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:141)

at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:196)

at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:221)

at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:140)

at iie.wxcj.MainSetup.init(MainSetup.java:35)

at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:270)

at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:119)

at org.nutz.mvc.ActionHandler.(ActionHandler.java:19)

at org.nutz.mvc.NutFilter.init(NutFilter.java:77)

at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)

at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)

at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:107)

at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)

at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)

at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:745)

Caused by: org.nutz.ioc.IocException: java.sql.SQLException: oracle.jdbc.driver.OracleDriver FAIL to create Ioc Bean name=[dataSource]

beacase [java.sql.SQLException: oracle.jdbc.driver.OracleDriver]

at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:141)

at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:196)

at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)

at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:73)

... 24 more

谢谢解答!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值