The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

michaell (2) [Avatar] Offline
Another problem has been occurred at Chapter 11 Ibatis.
I have no idea about why the test has been failed.

Please advise!

Test set: net.chrisrichardson.foodToGo.viewOrdersTransactionScripts.dao.OrderDAOIBatisImplTests
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.656 sec <<< FAILURE!
testFindOrdersWithoutRonum(net.chrisrichardson.foodToGo.viewOrdersTransactionScripts.dao.OrderDAOIBatisImplTests) Time elapsed: 3.475 sec <<< ERROR!
com.ibatis.sqlmap.client.SqlMapException: There is no statement named findOrders in this SqlMap.
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement(
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(
at org.springframework.orm.ibatis.SqlMapClientTemplate$4.doInSqlMapClient(
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(
at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(
at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(
at net.chrisrichardson.foodToGo.viewOrdersTransactionScripts.dao.OrderDAOIBatisImpl.findOrdersInlineWithoutRownum(
at net.chrisrichardson.foodToGo.viewOrdersTransactionScripts.dao.OrderDAOIBatisImplTests.testFindOrdersWithoutRonum(
michaell (2) [Avatar] Offline
Re: test failure at Ch 11 Ibatis
I have resolved the problem.
I have run the "mvn install" at every sub folders of each chapters.
Then the build and test has been successfully done.
I don't know why...
By the way, I am trying to make an eclipse project and am trying to test with IBM RAD6.

ceracm (113) [Avatar] Offline
Re: test failure at Ch 11 Ibatis

You should be able to just run 'mvn install' in the top level.

I guess I would do a 'mvn install clean' and see what happens.
If the individual installs succeeded I would expect the top-level to do so also.
To debug the problem I would need to see what tests failed - what is in the target/surefire-reports directories.
Did you set MAVEN_OPTS to increase the heap size?

ceracm (113) [Avatar] Offline
Re: test failure at Ch 11 Ibatis
To create the eclipse projects just run 'mvn eclipse:eclipse' at the top-level.
That will create eclipse projects in the subdirs.

foreverman (4) [Avatar] Offline
Re: test failure at Ch 11 Ibatis
This error occurs in module "pia-ch-11-queries-ibatis". it seems that it loads sqlMap-config.xml in module "pia-ch-09-transaction-scripts" instead of its own because it depends on module "pia-ch-09-transaction-scripts". So it can't find corresponding sql map
queries. (i don't know why this problem doesn't exist when i run command "mvn install" in directory "pia-ch-11-queries-ibatis").

The same problem does exist in module "pia-ch-12-concurrency-transaction-script".

My solution: rename sqlMap-config.xml to another name such as sqlMap-config_09.xml
in directory "pia-ch-09-transaction-scriptssrcmain esources", then modify "place-order-ibatis-config.xml" and "place-order-ibatis-dao.xml" to point to new sqlMap file name:sqlMap-config_09.xml. So module "pia-ch-12-concurrency-transaction-script" and module "pia-ch-11-queries-ibatis" will never load sqlMap-config.xml in module "pia-ch-09-transaction-scripts".
Hope this can help.