Hi,
When I run the PetStore application
Following error I am getting following Error.
javax.servlet.ServletException: Exception creating
bean of class
com.ibatis.jpetstore.presentation.CatalogBean: {1}
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
I tried to write test case as follows
/���.
*************************************************************************************************************************************************************************************************8
DaoManager daomanager = null ;
Account account = new Account();
protected void setUp() throws Exception {
//super.setUp();
daomanager = DaoConfig.getDaomanager();
}
public void testGetList()
{
List list = new ArrayList();
AccountSqlMapDao acmap = new
AccountSqlMapDao(daomanager);
list = acmap.getUsernameList();
assertNotNull(list);
}
public static void main(String[] args) {
junit.textui.TestRunner.run(AccountDAOTest.class);
����������������./
***********************************************************************************************************************
When I run the test case class the following is error.
java.lang.ExceptionInInitializerError
at
iBatisTesting.AccountDAOTest.setUp(AccountDAOTest.java:34)
at
junit.framework.TestCase.runBare(TestCase.java:125)
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:118)
at
junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:410)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:294)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:182)
Caused by: java.lang.RuntimeException: Could not
initialize DaoConfig. Cause:
com.ibatis.sqlmap.client.SqlMapException: There was an
error while building the SqlMap instance.
--- The error occurred in
properties/database.properties.
--- The error occurred while configuring the data
source.
--- Check the data source properties or configuration.
--- Cause: com.ibatis.sqlmap.client.SqlMapException:
Error initializing DataSource. Could not instantiate
DataSourceFactory. Cause:
com.ibatis.common.exception.NestedRuntimeException:
SimpleDataSource: Error while loading properties.
Cause: java.lang.ClassNotFoundException:
oracle.jdbc.driver.OracleDriver
Caused by: java.lang.ClassNotFoundException:
oracle.jdbc.driver.OracleDriver
Caused by:
com.ibatis.common.exception.NestedRuntimeException:
SimpleDataSource: Error while loading properties.
Cause: java.lang.ClassNotFoundException:
oracle.jdbc.driver.OracleDriver
Caused by: java.lang.ClassNotFoundException:
oracle.jdbc.driver.OracleDriver
Caused by: com.ibatis.sqlmap.client.SqlMapException:
Error initializing DataSource. Could not instantiate
DataSourceFactory. Cause:
com.ibatis.common.exception.NestedRuntimeException:
SimpleDataSource: Error while loading properties.
Cause: java.lang.ClassNotFoundException:
oracle.jdbc.driver.OracleDriver
Caused by: java.lang.ClassNotFoundException:
oracle.jdbc.driver.OracleDriver
Caused by:
com.ibatis.common.exception.NestedRuntimeException:
SimpleDataSource: Error while loading properties.
Cause: java.lang.ClassNotFoundException:
oracle.jdbc.driver.OracleDriver
Caused by: java.lang.ClassNotFoundException:
oracle.jdbc.driver.OracleDriver
at
com.ibatis.jpetstore.persistence.DaoConfig.<clinit>(DaoConfig.java:33)
... 11 more
**************************************************************************************************************************
I have one doubt As we read dao.xml in DaoConfig.java
where we read sql-map-config.xml file?
Rgds
__________________________________
Do you Yahoo!?
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250