Appfuse,Running On Oracle时出现NoSuchTableException错误的解决
2015-05-13 21:03
537 查看
Appfuse,Running On Oracle时出现NoSuchTableException错误的解决作者:陈海青(joson chen)(http://www.chq.name)2006.08.01(版权所有:陈海青(joson chen) www.chq.name Copyright (C) 陈海青(joson chen) www.chq.name All Rights Reserved
转载或引用本网版权所有之内容须注明“转自(或引自)chq.name (Junit fans)”字样, 并标明本网站网址http://www.chq.name
)引言:最近,根据Appfuse的文档,学习配置在appfuse上使用oracle数据库。在设置过程中出现了错误,几经周折,终于解决,记录下来,供参考。Appfuse版本:1.9.3Oracle版本:9.2一、问题的出现:在按照文档要求,需要完成以下几步:1) Create Database Schema :chq;2) Setup JDBC Driver ;3) Edit build.properties in the main AppFuse Directory ;4) Generate Application;5)Deploy Application ;6) Test Database Access 。在执行时第5步发布程序ant setup时,程序报错:org.dbunit.dataset.NoSuchTableException,屏幕输出如下:$ ant db-loadBuildfile: build.xmlinit:prepare:[echo] Preparing target directory 'D:developmytest/build/mytest'db-load:[dbunit] Executing operation: CLEAN_INSERT[dbunit] on file: D:developmytestmetadatasqlsample-data.xml[dbunit] with format: xmlBUILD FAILEDD:developmytestbuild.xml:714: org.dbunit.dataset.NoSuchTableException: user_roleTotal time: 3 seconds二、问题的解决1:首先根据错误信息检查相关配置文件D:developmytestbuild.properties,D:developmytestbuild.xml和导入数据文件:D:developmytestmetadatasqlsample-data.xml,发现与文档要求是一致的。2:在网上搜索,根据一些人的建议,进行修改,均没有效果3:对数据库启用全局sql语句跟踪,查找执行的语句,并进行分析,终于解决,看到了盼望已久的success:,屏幕输出:$ ant db-loadBuildfile: build.xmlinit:prepare:[echo] Preparing target directory 'D:developmytest/build/mytest'db-load:[dbunit] Executing operation: CLEAN_INSERT[dbunit] on file: D:developmytestmetadatasqlsample-data.xml[dbunit] with format: xmlBUILD SUCCESSFULTotal time: 3 seconds三、小结1:这次问题解决的核心是配置好build.properties文件,特别是以下语句:database.username=usernamedatabase.schema=schemaname (case sensitive using 10g)要注意,在使用oracle9时,由于默认情况下,所有的标识符(包括数据库各种对象名、用户名等)均以大写形式保存在数据库字典里,除非以引号包裹的形式强行指定为小写。所以这里的database.username和database.schema要与数据库中的一致,一般情况下为大写。2:appfuse 1.9.3的build.xml和metadatasqlsample-data.xml两个文件已经没问题了,除了参照appfuse文档设置为使用oracle外,不必额外修改。网上不少文章谈到要修改这两个文件中的内容,如sample-data.xml里表名前加上schema名、表名大写、直接设置build.xml的“operation”属性值等可能是针对以前版本的。我的测试结果是:sample-data.xml里表名前加上schema名汇报错;表名大小写不敏感.3:其他设置按照appfuse文档要求进行设置。4:注意在设置build.properties时,井号符号”#”只有在行首时才是注释符号,如以下语句database.schema=schemaname #(case sensitive using 10g)会被解析为:schema名为“schemaname #(case sensitive using 10g)”,这是错误的,应该为database.schema=schemaname #(case sensitive using 10g)四、相关资料:1、 http://appfuse.org/wiki/2、 使用oracle的系统跟踪功能调试java程序(http://www.chq.name/content/view/126/59/)3、 我的配置文件:1)metadatasqlsample-data.xml:
id usernamepasswordfirst_name。。。。。。
2)D:developmytestbuild.properties……# modi by chq,for use oracle-->modi by chq,for use oracle-->database.jar=${lib.dir}/oracle/ojdbc14.jardatabase.type=oracledatabase.host=192.168.1.1#use the database schema owner and password created in step #1 above heredatabase.username=chqdatabase.password=chqdatabase.schema=CHQhibernate.dialect=org.hibernate.dialect.Oracle9Dialectdatabase.driver_ <database.url=jdbc:oracle:thin:@192.168.1.1:1521:chq3)D:developmytestbuild.xml,要改两个target,。。。。。。
转载或引用本网版权所有之内容须注明“转自(或引自)chq.name (Junit fans)”字样, 并标明本网站网址http://www.chq.name
)引言:最近,根据Appfuse的文档,学习配置在appfuse上使用oracle数据库。在设置过程中出现了错误,几经周折,终于解决,记录下来,供参考。Appfuse版本:1.9.3Oracle版本:9.2一、问题的出现:在按照文档要求,需要完成以下几步:1) Create Database Schema :chq;2) Setup JDBC Driver ;3) Edit build.properties in the main AppFuse Directory ;4) Generate Application;5)Deploy Application ;6) Test Database Access 。在执行时第5步发布程序ant setup时,程序报错:org.dbunit.dataset.NoSuchTableException,屏幕输出如下:$ ant db-loadBuildfile: build.xmlinit:prepare:[echo] Preparing target directory 'D:developmytest/build/mytest'db-load:[dbunit] Executing operation: CLEAN_INSERT[dbunit] on file: D:developmytestmetadatasqlsample-data.xml[dbunit] with format: xmlBUILD FAILEDD:developmytestbuild.xml:714: org.dbunit.dataset.NoSuchTableException: user_roleTotal time: 3 seconds二、问题的解决1:首先根据错误信息检查相关配置文件D:developmytestbuild.properties,D:developmytestbuild.xml和导入数据文件:D:developmytestmetadatasqlsample-data.xml,发现与文档要求是一致的。2:在网上搜索,根据一些人的建议,进行修改,均没有效果3:对数据库启用全局sql语句跟踪,查找执行的语句,并进行分析,终于解决,看到了盼望已久的success:,屏幕输出:$ ant db-loadBuildfile: build.xmlinit:prepare:[echo] Preparing target directory 'D:developmytest/build/mytest'db-load:[dbunit] Executing operation: CLEAN_INSERT[dbunit] on file: D:developmytestmetadatasqlsample-data.xml[dbunit] with format: xmlBUILD SUCCESSFULTotal time: 3 seconds三、小结1:这次问题解决的核心是配置好build.properties文件,特别是以下语句:database.username=usernamedatabase.schema=schemaname (case sensitive using 10g)要注意,在使用oracle9时,由于默认情况下,所有的标识符(包括数据库各种对象名、用户名等)均以大写形式保存在数据库字典里,除非以引号包裹的形式强行指定为小写。所以这里的database.username和database.schema要与数据库中的一致,一般情况下为大写。2:appfuse 1.9.3的build.xml和metadatasqlsample-data.xml两个文件已经没问题了,除了参照appfuse文档设置为使用oracle外,不必额外修改。网上不少文章谈到要修改这两个文件中的内容,如sample-data.xml里表名前加上schema名、表名大写、直接设置build.xml的“operation”属性值等可能是针对以前版本的。我的测试结果是:sample-data.xml里表名前加上schema名汇报错;表名大小写不敏感.3:其他设置按照appfuse文档要求进行设置。4:注意在设置build.properties时,井号符号”#”只有在行首时才是注释符号,如以下语句database.schema=schemaname #(case sensitive using 10g)会被解析为:schema名为“schemaname #(case sensitive using 10g)”,这是错误的,应该为database.schema=schemaname #(case sensitive using 10g)四、相关资料:1、 http://appfuse.org/wiki/2、 使用oracle的系统跟踪功能调试java程序(http://www.chq.name/content/view/126/59/)3、 我的配置文件:1)metadatasqlsample-data.xml:
2)D:developmytestbuild.properties……# modi by chq,for use oracle-->modi by chq,for use oracle-->database.jar=${lib.dir}/oracle/ojdbc14.jardatabase.type=oracledatabase.host=192.168.1.1#use the database schema owner and password created in step #1 above heredatabase.username=chqdatabase.password=chqdatabase.schema=CHQhibernate.dialect=org.hibernate.dialect.Oracle9Dialectdatabase.driver_ <database.url=jdbc:oracle:thin:@192.168.1.1:1521:chq3)D:developmytestbuild.xml,要改两个target,。。。。。。
相关文章推荐
- Appfuse,Oracle出现 NoSuchTableException错误的解决
- Android开发——数据库框架Sugar出现no such table xxxx错误的解决办法
- android.database.sqlite.SQLiteException: no such table出现原因与解决办法
- Ruby on Rails安装过程中出现"no such file to load -- mkmf"错误的解决方法。
- Hibernate出现javax.naming.NoInitialContextException 错误的解决办法
- Android使用ormlite第三方数据库lib出现no such table错误的另外一种情况
- coc 4000 os2d-x-2.2中编译cocos2d-win32.vc2010.sln出现:C1083 pthread.h No such file or director错误的解决办法
- (转)cvsNT 2.5.03添加用户后出现"no such user"错误的解决方法
- No such table xxx错误的原因、解决办法:
- Hibernate出现javax.naming.NoInitialContextException 错误的解决办法
- shell脚本执行后出现错误提示" /bin/bash^M: bad interpreter: No such file or dire"的解决办法
- cvsNT 2.5.03.2382添加用户后出现"no such user"错误的解决方法
- 在Ubuntu安装完成后更改默认的语言LANG,出现Cannot set LC_CTYPE to default locale: No such file or directory错误的解决办法
- 项目文件.NET下编译C++代码时出现fatal error C1083: 无法打开包括文件:“xuhk_JNIHelloWorld.h”: No such file or directory错误的解决方法。
- 访问SQLite数据库遇到no such table 错误的解决办法
- Cacti安装nginx状态监控时出现No such file or directory错误的解决办法
- 触摸屏校准没反应,启动时出现No raw modules loaded.ts_config:No such file or directory错误的解决
- NoSuchObjectException(message:default.simple table not found) 问题解决【SOLVED】
- linux QT 安装出现No space left on device错误 解决方法
- Ubuntu 升级错误信息:mount: mounting none on /dev failed: no such device的解决办法