[Seasar-user:6788] [S2Dao] Daoのテストでエラー
satoh
[E-MAIL ADDRESS DELETED]
2007年 3月 20日 (火) 20:29:45 JST
佐藤徹太郎です。
お世話になっております。
Dolteng 0.17.0(Teeda + S2Dao)で開発をしております。
DaoをJUnitでテストするとエラーがでます。
障害トレースには、以下のように表示されます。
org.seasar.framework.exception.SQLRuntimeException: [ESSR0071]SQLで例外
(ErrorCode=42122, SQLState=42S22)が発生しました。理由はorg.seasar.framework.
exception.SSQLException: [ESSR0072]SQLで例外(SQL=[select book.id,
bookSpec.title, book.shelfNumber, book.rowNumberfrom book, bookSpecwhere
book.id=? and book.bookSpecId=bookSpec.id], ErrorCode={1}, SQLState={2})が発
生しました
at
org.seasar.extension.jdbc.util.ConnectionUtil.prepareStatement(ConnectionUti
l.java:52)
at
org.seasar.extension.jdbc.impl.BasicStatementFactory.createPreparedStatement
(BasicStatementFactory.java:34)
at
org.seasar.extension.jdbc.impl.BasicHandler.prepareStatement(BasicHandler.ja
va:95)
at
org.seasar.extension.jdbc.impl.BasicSelectHandler.prepareStatement(BasicSele
ctHandler.java:146)
at
org.seasar.extension.jdbc.impl.BasicSelectHandler.execute(BasicSelectHandler
.java:131)
at
org.seasar.extension.jdbc.impl.BasicSelectHandler.execute(BasicSelectHandler
.java:120)
at
org.seasar.dao.impl.SelectDynamicCommand.execute(SelectDynamicCommand.java:5
5)
at
org.seasar.dao.interceptors.S2DaoInterceptor.invoke(S2DaoInterceptor.java:53
)
at
book.chura.dao.BookDao$$EnhancedByS2AOP$$20fa83$$MethodInvocation$$findBookI
nfo0.proceed(MethodInvocationClassGenerator.java)
at
org.seasar.framework.aop.interceptors.TraceInterceptor.invoke(TraceIntercept
or.java:59)
at
book.chura.dao.BookDao$$EnhancedByS2AOP$$20fa83$$MethodInvocation$$findBookI
nfo0.proceed(MethodInvocationClassGenerator.java)
at
book.chura.dao.BookDao$$EnhancedByS2AOP$$20fa83.findBookInfo(BookDao$$Enhanc
edByS2AOP$$20fa83.java)
at
book.chura.dao.ReturnBookDaoTest.testFindBookInfo(ReturnBookDaoTest.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:164)
at
org.seasar.framework.unit.S2FrameworkTestCase.doRunTest(S2FrameworkTestCase.
java:305)
at
org.seasar.extension.unit.S2TestCase.doRunTest(S2TestCase.java:92)
at
org.seasar.framework.unit.S2FrameworkTestCase.runBare(S2FrameworkTestCase.ja
va:190)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at
junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3T
estReference.java:128)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:3
8)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:196)
Caused by: org.seasar.framework.exception.SSQLException: [ESSR0072]SQLで例外
(SQL=[select book.id, bookSpec.title, book.shelfNumber, book.rowNumberfrom
book, bookSpecwhere book.id=? and book.bookSpecId=bookSpec.id],
ErrorCode={1}, SQLState={2})が発生しました
at
org.seasar.extension.dbcp.impl.ConnectionWrapperImpl.wrapException(Connectio
nWrapperImpl.java:526)
at
org.seasar.extension.dbcp.impl.ConnectionWrapperImpl.prepareStatement(Connec
tionWrapperImpl.java:144)
at
org.seasar.extension.jdbc.util.ConnectionUtil.prepareStatement(ConnectionUti
l.java:50)
... 32 more
Caused by: org.h2.jdbc.JdbcSQLException: Column BOOK.ID not found; SQL
statement: select book.id, bookSpec.title, book.shelfNumber,
book.rowNumberfrom book, bookSpecwhere book.id=? and
book.bookSpecId=bookSpec.id [42S22-30]
org.h2.jdbc.JdbcSQLException: Column BOOK.ID not found; SQL statement:
select book.id, bookSpec.title, book.shelfNumber, book.rowNumberfrom book,
bookSpecwhere book.id=? and book.bookSpecId=bookSpec.id [42S22-30]
at org.h2.message.Message.addSQL(Message.java:338)
at org.h2.command.Parser.prepareCommand(Parser.java:210)
at org.h2.engine.Session.prepareLocal(Session.java:170)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:
200)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:127)
at java.lang.Thread.run(Thread.java:595)
org.h2.jdbc.JdbcSQLException: Column BOOK.ID not found [42S22-30]
at org.h2.message.Message.getSQLException(Message.java:67)
at org.h2.message.Message.getSQLException(Message.java:49)
at
org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:111)
at org.h2.command.dml.Select.prepare(Select.java:461)
at org.h2.command.Parser.prepareCommand(Parser.java:190)
at org.h2.engine.Session.prepareLocal(Session.java:170)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:
200)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:127)
at java.lang.Thread.run(Thread.java:595)
[42S22-30]
at org.h2.engine.SessionRemote.done(SessionRemote.java:288)
at org.h2.command.CommandRemote.prepare(CommandRemote.java:40)
at org.h2.command.CommandRemote.<init>(CommandRemote.java:54)
at
org.h2.engine.SessionRemote.prepareCommand(SessionRemote.java:224)
at
org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:946)
at
org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:1082)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.
java:135)
at
org.seasar.extension.dbcp.impl.ConnectionWrapperImpl.prepareStatement(Connec
tionWrapperImpl.java:140)
... 33 more
コンソールには、以下が表示されます。
DEBUG 2007-03-20 19:18:55,046 [main] クラス
(book.chura.dao.BookInfoDao[bookInfoDao])のコンポーネント定義を登録します
DEBUG 2007-03-20 19:18:55,093 [main] クラス
(book.chura.dao.RentInfoDao[rentInfoDao])のコンポーネント定義を登録します
DEBUG 2007-03-20 19:18:55,203 [main] クラス(book.chura.dao.BookDao[bookDao])
のコンポーネント定義を登録します
DEBUG 2007-03-20 19:18:55,296 [main] BEGIN
book.chura.dao.BookDao#findBookInfo(039911175)
DEBUG 2007-03-20 19:18:55,500 [main] 物理的なコネクションを取得しました
DEBUG 2007-03-20 19:18:55,500 [main] 論理的なコネクションを取得しました
DEBUG 2007-03-20 19:18:55,734 [main] 論理的なコネクションを閉じました
DEBUG 2007-03-20 19:18:55,828 [main] select book.id, bookSpec.title,
book.shelfNumber, book.rowNumberfrom book, bookSpecwhere book.id='039911175'
and book.bookSpecId=bookSpec.id
DEBUG 2007-03-20 19:18:55,828 [main] 論理的なコネクションを取得しました
DEBUG 2007-03-20 19:18:55,843 [main] 物理的なコネクションを閉じました
DEBUG 2007-03-20 19:18:55,843 [main] END
book.chura.dao.BookDao#findBookInfo(039911175)
Throwable:org.seasar.framework.exception.SQLRuntimeException: [ESSR0071]SQL
で例外(ErrorCode=42122, SQLState=42S22)が発生しました。理由は
org.seasar.framework.exception.SSQLException: [ESSR0072]SQLで例外
(SQL=[select book.id, bookSpec.title, book.shelfNumber, book.rowNumberfrom
book, bookSpecwhere book.id=? and book.bookSpecId=bookSpec.id],
ErrorCode={1}, SQLState={2})が発生しました
このエラーの対処方法ご存知の方、ご教授いただけないでしょうか?
宜しく、御願い致します。
-------------- next part --------------
HTMLの添付ファイルを保管しました...
URL: http://ml.seasar.org/archives/seasar-user/attachments/20070320/8e219722/attachment.html
Seasar-user メーリングリストの案内