NutzCN Logo
问答 求大佬指点,Nutz框架的项目Tomcat debug运行报错,求指点
发布于 2434天前 作者 LJ793817362 1885 次浏览 复制 上一个帖子 下一个帖子
标签:

org.nutz.ioc.IocException: IocBean[dao] throw Exception when creating
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:149)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:146)
at com.wonders.Setup.init(Setup.java:53)
at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:274)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:121)
at org.nutz.mvc.ActionHandler.(ActionHandler.java:19)
at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4958)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5652)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
INFO 16:41:21 NutLoading.load(141)-->Nutz.Mvc[nutz] is up in 7639ms
INFO 16:41:21 NutFilter._init(117)-->exclusionsPrefix = ^(/assets/|/druid/|/upload/|/apidoc/)
Caused by: java.lang.RuntimeException: IocBean[dao] fail at field=[dataSource]
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:56)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:135)
... 21 more
Caused by: org.nutz.ioc.IocException: IocBean[dataSource] throw Exception when creating
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:149)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
... 23 more
Caused by: java.lang.RuntimeException: java.sql.SQLException: ORA-00942: 表或视图不存在

at org.nutz.lang.Lang.wrapThrow(Lang.java:184)
at org.nutz.lang.Lang.wrapThrow(Lang.java:183)
at org.nutz.ioc.trigger.MethodEventTrigger.trigger(MethodEventTrigger.java:21)
at org.nutz.ioc.weaver.DefaultWeaver.onCreate(DefaultWeaver.java:72)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
... 26 more

Caused by: java.sql.SQLException: ORA-00942: 表或视图不存在

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:790)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1031)
at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:830)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1124)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1264)
at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1240)
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1450)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:632)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.nutz.ioc.trigger.MethodEventTrigger.trigger(MethodEventTrigger.java:18)
... 28 more
30 回复

看到 插入日志 按钮没?

回复按钮旁边有个按钮,看不到??

@wendal 哦哦,看到了,把日志通过它插入进来?

org.nutz.ioc.IocException: IocBean[dao] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:149)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:146)
	at com.wonders.Setup.init(Setup.java:53)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:274)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:121)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4958)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5652)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: IocBean[dao] fail at field=[dataSource]
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
	at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:56)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:135)
	... 21 more
Caused by: org.nutz.ioc.IocException: IocBean[dataSource] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:149)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
	at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
	... 23 more
Caused by: java.lang.RuntimeException: java.sql.SQLException: ORA-00942: 表或视图不存在

	at org.nutz.lang.Lang.wrapThrow(Lang.java:184)
	at org.nutz.lang.Lang.wrapThrow(Lang.java:183)
	at org.nutz.ioc.trigger.MethodEventTrigger.trigger(MethodEventTrigger.java:21)
	at org.nutz.ioc.weaver.DefaultWeaver.onCreate(DefaultWeaver.java:72)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138)
	... 26 more
Caused by: java.sql.SQLException: ORA-00942: 表或视图不存在

	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
	at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
	at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:790)
	at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1031)
	at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:830)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1124)
	at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1264)
	at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1240)
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1450)
	at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:632)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.nutz.ioc.trigger.MethodEventTrigger.trigger(MethodEventTrigger.java:18)
	... 28 more

validateSql没写对,改正或者删掉

@wendal 额,是怎么看出来的,求指点,看日志我经常找不到错误原因

	at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1264)
	at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1240)

估计你还开启了testWhenBorrow,会影响性能的

@wendal

at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1264)
	at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1240)
	at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1450)

这是导入的一个包,DruidAbstractDataSource是一个.class文件,DruidAbstractDataSource的java文件不再项目里

那是druid的类,需要关联源码的

@wendal validateSql是指项目中写的sql语句吗?是指在resources文件夹下面的那些配置文件中吗?

一般在db.properties里面

@wendal 这个项目没有db.properties,resources/db下面只有一个20160826.sql文件

resources目录有没有*.properties文件,除了log4j

@wendal 除了log4j,只有application.properties

贴一下application.properties

@wendal

#
# 系统相关配置
#

uploadfiles.windows=d:/jygl/uploadfiles/

uploadfiles.linux=/home/jygl/uploadfiles/

#vm模板映射文件目录
vm.mapping.path vm/

app.path .

#文件上传的根路径

upload.rootPath jygl/uploadfiles/

#PRE_APPLY_PUB http://localhost:8080/cms/restServiceAPI/blockInfo/getBlockInfo
PRE_APPLY_PUB http://localhost:8088/cms/restServiceAPI/blockInfo/getBlockInfo

#server.ip 192.168.0.6
server.ip localhost

找找dao.js 或者 dao.json 或者 db.json 或者 db.js 贴出来

@wendal dao.js

var ioc = {
/*	dataSource : {
		type : "org.apache.commons.dbcp.BasicDataSource",
		events : {
			depose : 'close'
		},*/
		dataSource : {
            type : "com.alibaba.druid.pool.DruidDataSource",
            events : {
                create : "init",
                depose : 'close'
            },
		fields : {
			//url:'jdbc:oracle:thin:@10.168.105.48:1521:orcl',
			//url : 'jdbc:oracle:thin:@192.168.0.252:1521:orcl',
			url : 'jdbc:oracle:thin:@172.16.30.19:1521:orcl',
			//url : 'jdbc:oracle:thin:@127.0.0.1:1521:orcl',
			//url : 'jdbc:oracle:thin:@192.168.255.120:1521:orcl',
			driverClassName : 'oracle.jdbc.driver.OracleDriver',
			username : 'tjsc',
			password : 'tjsc',
			initialSize : 10,
			maxActive : 30,
			minIdle : 1,
			maxIdle : 30,
			validationQuery: 'select count(ID) from sys_user'
		}
	},
	dao : {
		type : "org.nutz.dao.impl.NutDao",
		fields : {
			dataSource : {
				refer : 'dataSource'
			}
		}
	}
};
validationQuery: 'select count(ID) from sys_user'

删掉这一行

@wendal 现在报这样的错误,是不是得把validationQuery: 'select count(ID) from sys_user'该一下?

java.sql.SQLException: ORA-00942: 表或视图不存在

	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
	at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
	at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:790)
	at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1031)
	at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:830)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1124)
	at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1264)
	at com.alibaba.druid.pool.DruidPooledStatement.executeQuery(DruidPooledStatement.java:143)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:246)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:53)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:66)
	at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64)
	at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:139)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:158)
	at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:125)
	at org.nutz.dao.impl.sql.run.NutDaoRunner._run(NutDaoRunner.java:92)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:81)
	at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:245)
	at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:257)
	at org.nutz.dao.impl.NutDao.query(NutDao.java:439)
	at org.nutz.dao.impl.NutDao.query(NutDao.java:444)
	at com.wonders.commons.base.Globals.initSysConfig(Globals.java:39)
	at com.wonders.Setup.initSysSetting(Setup.java:877)
	at com.wonders.Setup.init(Setup.java:57)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:274)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:121)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4958)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5652)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
org.nutz.dao.DaoException: !Nutz SQL Error: 'SELECT * FROM sys_config '
PreparedStatement: 
'SELECT * FROM sys_config '
CaseMessage=ORA-00942: 表或视图不存在

	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:104)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:66)
	at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22)
	at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64)
	at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:139)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:158)
	at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:125)
	at org.nutz.dao.impl.sql.run.NutDaoRunner._run(NutDaoRunner.java:92)
	at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:81)
	at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:245)
	at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:257)
	at org.nutz.dao.impl.NutDao.query(NutDao.java:439)
	at org.nutz.dao.impl.NutDao.query(NutDao.java:444)
	at com.wonders.commons.base.Globals.initSysConfig(Globals.java:39)
	at com.wonders.Setup.initSysSetting(Setup.java:877)
	at com.wonders.Setup.init(Setup.java:57)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:274)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:121)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4958)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5652)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: ORA-00942: 表或视图不存在

	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
	at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
	at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
	at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:790)
	at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1031)
	at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:830)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1124)
	at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1264)
	at com.alibaba.druid.pool.DruidPooledStatement.executeQuery(DruidPooledStatement.java:143)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:246)
	at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:53)
	... 32 more

这是nutzwk改造的项目吧?

一堆系统表没建, 这是你第一次跑这个项目吧??

@wendal 嗯,第一次跑这个项目,让远程连接异地数据库,把这个项目本地运行起来

@wendal 是不是得重新建立数据库啊?

估计是很老的nutzwk,需要手工导入sql初始化文件

@wendal 看来我得重新建库了,多谢你了

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