[Seasar-user:6008] daoのテストでエラー

satoh [E-MAIL ADDRESS DELETED]
2007年 2月 3日 (土) 10:45:40 JST


佐藤徹太郎です。 お世話になっております。

EclipseでChura Project(Teeda+S2Dao)を作って、DaoをJUnitでテストしたのですが
テスト失敗になってしまいます。

障害トレースには下記が表示されます。



java.lang.NoClassDefFoundError:
org/seasar/framework/util/ResourceNotFoundRuntimeException

              at java.lang.Class.forName0(Native Method)

              at java.lang.Class.forName(Class.java:242)

              at org.seasar.framework.util.ClassUtil.forName(ClassUtil.java:
72)

              at org.seasar.framework.container.factory.ComponentTagHandler.
start(ComponentTagHandler.java:46)

              at
org.seasar.framework.xml.SaxHandler.start(SaxHandler.java:156)

              at
org.seasar.framework.xml.SaxHandler.start(SaxHandler.java:150)

              at
org.seasar.framework.xml.SaxHandler.startElement(SaxHandler.java:63)

              at
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)

              at
org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)

              at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)

              at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(Unknown Source)

              at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)

              at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)

              at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)

              at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

              at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)

              at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)

              at
org.seasar.framework.util.SAXParserUtil.parse(SAXParserUtil.java:41)

              at
org.seasar.framework.xml.SaxHandlerParser.parse(SaxHandlerParser.java:65)

              at
org.seasar.framework.xml.SaxHandlerParser.parse(SaxHandlerParser.java:61)

              at
org.seasar.framework.container.factory.XmlS2ContainerBuilder.parse(XmlS2Cont
ainerBuilder.java:96)

              at
org.seasar.framework.container.factory.XmlS2ContainerBuilder.include(XmlS2Co
ntainerBuilder.java:87)

              at
org.seasar.framework.container.factory.S2ContainerFactory$DefaultProvider.in
clude(S2ContainerFactory.java:552)

              at
org.seasar.framework.container.factory.S2ContainerFactory.include(S2Containe
rFactory.java:170)

              at
org.seasar.framework.container.factory.IncludeTagHandler.start(IncludeTagHan
dler.java:58)

              at
org.seasar.framework.xml.SaxHandler.start(SaxHandler.java:156)

              at
org.seasar.framework.xml.SaxHandler.start(SaxHandler.java:148)

              at
org.seasar.framework.xml.SaxHandler.startElement(SaxHandler.java:63)

              at
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)

              at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)

              at
org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)

              at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)

              at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(Unknown Source)

              at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)

              at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)

              at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)

              at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

              at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)

              at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)

              at
org.seasar.framework.util.SAXParserUtil.parse(SAXParserUtil.java:41)

              at
org.seasar.framework.xml.SaxHandlerParser.parse(SaxHandlerParser.java:65)

              at
org.seasar.framework.xml.SaxHandlerParser.parse(SaxHandlerParser.java:61)

              at
org.seasar.framework.container.factory.XmlS2ContainerBuilder.parse(XmlS2Cont
ainerBuilder.java:96)

              at
org.seasar.framework.container.factory.XmlS2ContainerBuilder.include(XmlS2Co
ntainerBuilder.java:87)

              at
org.seasar.framework.container.factory.S2ContainerFactory$DefaultProvider.in
clude(S2ContainerFactory.java:552)

              at
org.seasar.framework.container.factory.S2ContainerFactory.include(S2Containe
rFactory.java:170)

              at
org.seasar.framework.unit.S2FrameworkTestCase.include(S2FrameworkTestCase.ja
va:160)

              at
ac.hiu.kt.tosho.dao.ReturnBookDaoTest.setUp(ReturnBookDaoTest.java:20)

              at
org.seasar.framework.unit.S2FrameworkTestCase.runBare(S2FrameworkTestCase.ja
va:178)

              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)



Chura Project(Teeda+S2Dao)で生成したプロジェクトにはもともとなかった
j2ee.diconを他のプロジェクトから

もってきてbookdao.diconの中でincludeしているのが原因でしょうか?



bookdao.diconは下記



<components namespace=”dao”>

    <include path=”j2ee.dicon”/>

    <include path=”dao.dicon”/>



    <component name=”BookInfoDao” class=”
ac.hiu.kt.tosho.dao.BookInfoDao”>

        <aspect>interceptor</aspect>

    </component>

</components>



テストクラスは下記



public class ReturnBookDaoTest extends S2DaoTestCase {

  BookInfoDao bookInfoDao;

  public ReturnBookDaoTest(String name) {

      super(name);

  }

  protected void setup() throws Exception {

      super.setUp();

      include(“bookdao.dicon”);

      include(“app.dicon);

  }

  public void testFindBookPosition() throws Exception {

      BookDTO bookDTO;

      bookDTO = bookInfoDao.findBookPosition(“039911174”);

      assertEquals(35, bookDTO.getSelfNumber());

      assertEquals(4, bookDTO.getRowNumber());

  }

}



以上、 わかる方おられませんでしょか?

宜しくお願い致します。





































































-------------- next part --------------
HTMLの添付ファイルを保管しました...
URL: http://ml.seasar.org/archives/seasar-user/attachments/20070203/cd3a9e02/attachment.html 


Seasar-user メーリングリストの案内