NutzCN Logo
问答 nutz创建完对应的bean又无故删除的问题
发布于 3166天前 作者 qq_4f7a40b4 1768 次浏览 复制 上一个帖子 下一个帖子
标签:

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)

3 回复

报错信息在后面,要看全了

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的源码

解决了,dbcp2对应的jar包没导全

添加回复
请先登陆
回到顶部