Buildfile: C:\MyJava\workspace\springapp\build.xml
build:
buildtests:
dropTables:
[echo] DROP TABLES USING: org.hsqldb.jdbcDriver jdbc:hsqldb:hsql//localhost
[sql] Executing commands
[sql] 1 of 1 SQL statements executed successfully
createTables:
[echo] CREATE TABLES USING: org.hsqldb.jdbcDriver jdbc:hsqldb:hsql//localhost
[sql] Executing resource: C:\MyJava\workspace\springapp\db\create_products.sql
[sql] 2 of 2 SQL statements executed successfully
loadData:
[echo] LOAD DATA USING: org.hsqldb.jdbcDriver jdbc:hsqldb:hsql//localhost
[sql] Executing resource: C:\MyJava\workspace\springapp\db\load_data.sql
[sql] 3 of 3 SQL statements executed successfully
dbTests:
[echo] dbTest ---------------------------------------
[junit] Running springapp.domain.ProductTests
[junit] Testsuite: springapp.domain.ProductTests
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0 sec
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 0 sec
[junit] Running springapp.repository.JdbcProductDaoTests
[junit] Testsuite: springapp.repository.JdbcProductDaoTests
[junit] Mar 3, 2010 4:44:46 PM org.springframework.test.AbstractSingleSpringContextTests loadContextLocations
[junit] INFO: Loading context for locations: classpath:test-context.xml
[junit] Mar 3, 2010 4:44:46 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
[junit] INFO: Loading XML bean definitions from class path resource [test-context.xml]
[junit] Mar 3, 2010 4:44:47 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
[junit] INFO: Refreshing [email protected]13d52: display name [[email protected]13d52]; startup date [Wed Mar 03 16:44:47 CST 2010]; root of context hierarchy
[junit] Mar 3, 2010 4:44:47 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
[junit] INFO: Bean factory for application context [[email protected]13d52]: org.s[email protected]1d86fd3
[junit] Mar 3, 2010 4:44:47 PM org.springframework.core.io.support.PropertiesLoaderSupport loadProperties
[junit] INFO: Loading properties file from class path resource [jdbc.properties]
[junit] Mar 3, 2010 4:44:47 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
[junit] INFO: Pre-instantiating singletons in org.s[email protected]1d86fd3: defining beans [productDao,dataSource,propertyConfigurer,transactionManager]; root of factory hierarchy
[junit] Mar 3, 2010 4:44:47 PM org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName
[junit] INFO: Loaded JDBC driver: org.hsqldb.jdbcDriver
[junit] Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 0.391 sec
[junit] Tests run: 2, Failures: 0, Errors: 2, Time elapsed: 0.391 sec
[junit] ------------- Standard Error -----------------
[junit] Mar 3, 2010 4:44:46 PM org.springframework.test.AbstractSingleSpringContextTests loadContextLocations
[junit] INFO: Loading context for locations: classpath:test-context.xml
[junit] Mar 3, 2010 4:44:46 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
[junit] INFO: Loading XML bean definitions from class path resource [test-context.xml]
[junit] Mar 3, 2010 4:44:47 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
[junit] INFO: Refreshing org.springframework.cont[email protected]: display name [[email protected]13d52]; startup date [Wed Mar 03 16:44:47 CST 2010]; root of context hierarchy
[junit] Mar 3, 2010 4:44:47 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
[junit] INFO: Bean factory for application context [[email protected]13d52]: org.s[email protected]1d86fd3
[junit] Mar 3, 2010 4:44:47 PM org.springframework.core.io.support.PropertiesLoaderSupport loadProperties
[junit] INFO: Loading properties file from class path resource [jdbc.properties]
[junit] Mar 3, 2010 4:44:47 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
[junit] INFO: Pre-instantiating singletons in org.s[email protected]1d86fd3: defining beans [productDao,dataSource,propertyConfigurer,transactionManager]; root of factory hierarchy
[junit] Mar 3, 2010 4:44:47 PM org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName
[junit] INFO: Loaded JDBC driver: org.hsqldb.jdbcDriver
[junit] ------------- ---------------- ---------------
[junit] Testcase: testGetProductList(springapp.repository.JdbcProductDaoTests): Caused an ERROR
[junit] Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: No suitable driver found for jdbc:hsqldb:hsql://localhost
[junit] org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: No suitable driver found for jdbc:hsqldb:hsql://localhost
[junit] at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:238)
[junit] at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:377)
[junit] at org.springframework.test.AbstractTransactionalSpringContextTests.startNewTransaction(AbstractTransactionalSpringContextTests.java:387)
[junit] at org.springframework.test.AbstractTransactionalSpringContextTests.onSetUp(AbstractTransactionalSpringContextTests.java:217)
[junit] at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:101)
[junit] at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
[junit] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[junit] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[junit] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[junit] Caused by: java.sql.SQLException: No suitable driver found for jdbc:hsqldb:hsql://localhost
[junit] at java.sql.DriverManager.getConnection(DriverManager.java:602)
[junit] at java.sql.DriverManager.getConnection(DriverManager.java:154)
[junit] at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:174)
[junit] at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:165)
[junit] at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149)
[junit] at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119)
[junit] at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:200)
[junit] Testcase: testSaveProduct(springapp.repository.JdbcProductDaoTests): Caused an ERROR
[junit] Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: No suitable driver found for jdbc:hsqldb:hsql://localhost
[junit] org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: No suitable driver found for jdbc:hsqldb:hsql://localhost
[junit] at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:238)
[junit] at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:377)
[junit] at org.springframework.test.AbstractTransactionalSpringContextTests.startNewTransaction(AbstractTransactionalSpringContextTests.java:387)
[junit] at org.springframework.test.AbstractTransactionalSpringContextTests.onSetUp(AbstractTransactionalSpringContextTests.java:217)
[junit] at org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:101)
[junit] at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:76)
[junit] at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[junit] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[junit] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[junit] Caused by: java.sql.SQLException: No suitable driver found for jdbc:hsqldb:hsql://localhost
[junit] at java.sql.DriverManager.getConnection(DriverManager.java:602)
[junit] at java.sql.DriverManager.getConnection(DriverManager.java:154)
[junit] at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:174)
[junit] at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:165)
[junit] at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149)
[junit] at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119)
[junit] at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:200)
[junit] Test springapp.repository.JdbcProductDaoTests FAILED
[junit] Running springapp.service.SimpleProductManagerTests
[junit] Testsuite: springapp.service.SimpleProductManagerTests
[junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 0 sec
[junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 0 sec
[junit] Running springapp.web.InventoryControllerTests
[junit] Testsuite: springapp.web.InventoryControllerTests
[junit] Mar 3, 2010 4:44:47 PM springapp.web.InventoryController handleRequest
[junit] INFO: Returning hello view with Wed Mar 03 16:44:47 CST 2010
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.031 sec
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.031 sec
[junit] ------------- Standard Error -----------------
[junit] Mar 3, 2010 4:44:47 PM springapp.web.InventoryController handleRequest
[junit] INFO: Returning hello view with Wed Mar 03 16:44:47 CST 2010
[junit] ------------- ---------------- ---------------
BUILD FAILED
C:\MyJava\workspace\springapp\build.xml:203: tests.failed=true
***********************************************************
***********************************************************
**** One or more tests failed! Check the output ... ****
***********************************************************
***********************************************************
Total time: 1 second
-1
A
回答
0
沒有因此錯誤是:
Could not open JDBC Connection for transaction;
nested exception is java.sql.SQLException:
No suitable driver found for jdbc:hsqldb:hsql://localhost
是HSQLDB
在classpath?我在你的Ant構建的早期部分正確地猜測它的引用,因爲這似乎工作。您的測試是否在不同的過程中產生,並且缺少類路徑條目?
相關問題
- 1. 如何從Ant構建文件設置Eclipse構建路徑和類路徑?
- 2. 類路徑在Ant構建文件
- 3. 設置Ant構建路徑
- 4. 高性能安全路徑和純路徑構建
- 5. Ant構建目錄正確
- 6. 屬性的Ant-Junit類路徑
- 7. 包括Android的Ant構建腳本的類路徑目錄
- 8. Ant構建文件和庫
- 9. Eclipse類路徑vs構建路徑
- 10. 在數據庫中存儲,檢索和重新構建路徑
- 11. 不正確的路徑與函數getcwd()
- 12. java ant build問題(沒有正確設置類路徑)
- 13. 如何從Ant Java類路徑構建Maven依賴關係?
- 14. 如何在Ant Junit任務中顯示類路徑構建
- 15. Eclipse/Ant構建失敗 - com.sun.tools.javac.Main不在類路徑上
- 16. 使用Ant構建後更改類路徑
- 17. 數據庫性能和數據類型
- 18. mongodb數據路徑的正確權限
- 19. 確定數據庫的文件路徑
- 20. Ant類路徑訂購
- 21. ANT +類路徑問題
- 22. Ant&Concordion:類路徑問題
- 23. Android Studio創建數據庫和架構的正確方法
- 24. Java的Ant構建與外部庫
- 25. 路徑在數據庫中的存儲是不正確的
- 26. 使用ANT構建「構建失敗:未能創建任務或輸入類路徑」
- 27. 如何解決不正確的SQLite數據庫路徑?
- 28. 關於數據庫結構和性能需要的建議
- 29. Maven和java構建路徑
- 30. php包含vs庫;正確的路徑
我不確定任何人都可以幫助像這樣說的問題。你能否試着重新解釋你的問題? – pajton 2010-03-03 22:47:23
對不起,那是我從螞蟻身上得到的輸出。我試圖找出爲什麼構建失敗每次無法檢測到驅動程序。其他測試運行良好,但不同的驅動程序正在由不同的測試失敗調用。即使一切看起來都很好,但屬性文件和類路徑設置仍然失敗。感謝任何幫助。謝謝。 – Walker 2010-03-03 22:55:48
我會發布您的Ant構建的*相關*部分,並在上面編輯以關注精確的錯誤。 – 2010-03-03 23:42:38