Appfuse,Oracle出现 NoSuchTableException错误的解决
2015-05-13 21:03
369 查看
引言: 最近,我根据Appfuse的文档,学习配置在appfuse上使用oracle数据库。在设置过程中出现了错误org.dbunit.dataset.NoSuchTableException,几经周折,终于解决,记录下来,供参考。 Appfuse版本:1.9.3 Oracle版本:9.2
Appfuse,Running On Oracle时出现NoSuchTableException错误的解决
引言: 最近,根据Appfuse的文档,学习配置在appfuse上使用oracle数据库。在设置过程中出现了错误,几经周折,终于解决,记录下来,供参考。 Appfuse版本:1.9.3 Oracle版本: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-load Buildfile: build.xml init: 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: xml BUILD FAILED D:developmytestuild.xml:714: org.dbunit.dataset.NoSuchTableException: user_role Total time: 3 seconds 二、问题的解决 1:首先根据错误信息检查相关配置文件D:developmytestuild.properties,D:developmytestuild.xml和导入数据文件:D:developmytestmetadatasqlsample-data.xml,发现与文档要求是一致的。 2:在网上搜索,根据一些人的建议,进行修改,均没有效果 3:对数据库启用全局sql语句跟踪,查找执行的语句,并进行分析,终于解决,看到了盼望已久的success:,屏幕输出: $ ant db-load Buildfile: build.xml init: 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: xml BUILD SUCCESSFUL Total time: 3 seconds 三、小结 1:这次问题解决的核心是配置好build.properties文件,特别是以下语句:database.username=username
database.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:
相关文章推荐
- Appfuse,Running On Oracle时出现NoSuchTableException错误的解决
- Android开发——数据库框架Sugar出现no such table xxxx错误的解决办法
- android.database.sqlite.SQLiteException: no such table出现原因与解决办法
- [解决方法]org.dbunit.dataset.NoSuchTableException: Did not find table 'tab1' in schema 'null'
- 访问SQLite数据库遇到no such table 错误的解决办法
- 在Ubuntu安装完成后更改默认的语言LANG,出现Cannot set LC_CTYPE to default locale: No such file or directory错误的解决办法
- django no such table: django_session 错误解决
- yum 更新163 源后出现 GPG key retrieval failed: No such file or directory的错误解决办法
- linux出现Cannot set LC_CTYPE to default locale: No such file or directory错误的解决办法
- cvsNT 2.5.03.2382添加用户后出现"no such user"错误的解决方法
- (转)cvsNT 2.5.03添加用户后出现"no such user"错误的解决方法
- android.database.sqlite.SQLiteException: no such table错误出现的原因及解决办法
- 引用原因.NET下编译C++代码时出现fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or directory错误的解决方法.
- 解决ProGuard混淆代码时出现的java.lang.NoSuchFieldException: xxx…异常
- 在Ubuntu安装完成后更改默认的语言LANG,出现Cannot set LC_CTYPE to default locale: No such file or directory错误的解决办法
- 在Ubuntu安装完成后更改默认的语言LANG,出现Cannot set LC_CTYPE to default locale: No such file or directory错误的解决办法
- Qt5编译时出现<QtGui/QApplication> ---> No such file or directory错误解决办法
- php服务器出现CodeIgniter错误mysql_connect(): No such file or directory解决方法
- [c错误解决]NiosII9.0 build 时出现:No CFI table found at address 0x00C00000
- .NET下编译C++代码时出现fatal error C1083: 无法打开包括文件:“xuhk_JNIHelloWorld.h”: No such file or directory错误的解决方法。