2016-3-16 20:48:29.491 DEBUG [http-bio-8080-exec-3] Load class org.nutz.dao.impl.NutDao without AOP
2016-3-16 20:48:29.491 DEBUG [http-bio-8080-exec-3] Save object 'dao' to [app]
2016-3-16 20:48:29.494 DEBUG [http-bio-8080-exec-3] Get 'dataSource'<>
2016-3-16 20:48:29.494 DEBUG [http-bio-8080-exec-3] >> Load definition name=dataSource
2016-3-16 20:48:29.494 DEBUG [http-bio-8080-exec-3] Loading define for name=dataSource
2016-3-16 20:48:29.500 DEBUG [http-bio-8080-exec-3] Found IocObject(dataSource) in IocLoader(JsonLoader@1966305)
2016-3-16 20:48:29.501 DEBUG [http-bio-8080-exec-3] >> Make...'dataSource'<>
2016-3-16 20:48:29.503 DEBUG [http-bio-8080-exec-3] Remove object 'dao' from [app]
2016-3-16 20:48:29.503 DEBUG [http-bio-8080-exec-3] Remove object 'userDao' from [app]
2016-3-16 20:48:29.504 DEBUG [http-bio-8080-exec-3] Remove object 'userService' from [app]
2016-3-16 20:48:29.504 DEBUG [http-bio-8080-exec-3] Remove object 'userAction' from [app]
2016-3-16 20:48:29.505 WARN [http-bio-8080-exec-3] Error@/user/add :
org.nutz.ioc.IocException: org/apache/commons/pool2/PooledObjectFactory For object [dataSource] - type:[] FAIL to create Ioc Bean name=[dao] FAIL to create Ioc Bean name=[userDao] FAIL to create Ioc Bean name=[userService] FAIL to create Ioc Bean name=[userAction]
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:147)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:204)
var ioc = {
config : {
type : "org.nutz.ioc.impl.PropertiesProxy",
fields : {
paths : [ "jdbc.properties" ]
}
},
dataSource : {
type : "org.apache.commons.dbcp2.BasicDataSource",
events : {
depose : 'close'
},
fields : {
driverClassName : {
java : "$config.get('db-driver')"
},
url : {
java : "$config.get('db-url')"
},
username : {
java : "$config.get('db-username')"
},
password : {
java : "$config.get('db-password')"
},
initialSize : {
java : "$config.get('db-initialSize')"
},
maxIdle : {
java : "$config.get('db-maxIdle')"
},
testOnBorrow:"true",
validationQuery: "select 1 from dual"
}
},
filesql : {
type : "org.nutz.dao.impl.FileSqlManager",
args : "sql"
},
dao : {
type : "org.nutz.dao.impl.NutDao",
args : [ {
refer : 'dataSource'
}, {
refer : 'filesql'
} ]
}
};
这是配置dao.js的源码