It seems the issue is my <dynamic> tag in the <select> element. Anyone have an idea why the following is unacceptable? I have version 2.1.5. As far as I can tell it conforms.
Thanks, Niels <select id="getPurchaseHeader" parameterClass="PurchaseHeader" resultMap="PurchaseHeader-result" > select order_no , status_code , order_date , user_id , user_name , charge_to_corp , franchise_location , corp_location , order_type , supplier_no , pa_code , fob_point , ship_via , payment_terms_code , project_number , backhaul_flag , advance_ship_notice , attention , phone , check_no , check_date , total_paid_check , total_paid_order , freight_amount , ap_attachments , ap_separate_check , no_of_payments , payment_cycle , first_due_date , orig_po_no , sup_ref_no , sup_ref_date , tax_code , gl_tax_no , orig_due_date , rev_due_date , begin_pay_terms_date , longest_lead_time , tax_rate , no_of_receipts , no_of_validation , total_order_amount , prev_check_no , bank_id , prev_bank_id , mg_tracking_no , accounting_period , charge_to_id , charge_to_name , cate_onestep_flag , processing_corp , check_descr_code , check_descr , freight_taxable_flag , change_no , record_date , last_act_date , supplier_location_no , closed_date , loc_id , purch_tax_ent_id , po_multi_chrgto_flg , po_adnd_flg , po_bkord_flg , po_bkord_orig_no , po_bkord_prnt_no , po_orig_user_id , po_paybill_flg , po_frght_tax_amt , po_splr_tax_amt , supplier_shipfrom_location_no , row_last_updt_user_id , splr_invoice_dte , po_canc_reas_cde , po_rcvd_full_flg , po_bkord_remain_qty , purch_rqstr_loc_id , po_frght_tax_lvl_1_amt , po_frght_tax_lvl_2_amt , po_frght_tax_lvl_1_txbl_flg , po_frght_tax_lvl_2_txbl_flg , crcy_cde , crcy_rate from PURCHASE_HEADER <dynamic prepend="where"> <isNotEmpty prepend="and" property="orderNo"> order_no = #orderNo# </isNotEmpty> <isNotEmpty prepend="and" property="userId"> user_id = #userId" </isNotEmpty> <isNotEmpty prepend="and" property="userName"> user_name = #userName# </isNotEmpty> <isNotEmpty prepend="and" property="supplierNo"> supplier_no = #supplierNo# </isNotEmpty> </dynamic> </select> -----Original Message----- From: Voorhoeve, Niels {PBG} [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 11, 2005 11:44 AM To: user-java@ibatis.apache.org Subject: Junit / Ibatis Configuration Problem Hi, I'm having trouble using junit to test my ibatis setup. I am able to run 'static void main' tests within Eclipse with no problem. However when I run the same test within Junit it fails. It seems that Ibatis has trouble parsing the configuration files when run via Junit and generates tons of Xpath-related exceptions. It makes no difference whether I run the Junit tests via Eclipse or Ant on the command line. I tried moving all the test, configuration files and ibatis-related java files to the same package and that did not help. Has anyone dealt with this issue before? Thanks, Niels $ ant test Buildfile: build.xml test: [junit] Testsuite: com.pbg.aps.model.junit.ModelIBatisTestSuite [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 1.047 sec [junit] ------------- Standard Output --------------- [junit] 2005-10-11 11:19:49,250 [main] ERROR com.pbg.aps.model.junit.TestDbConfig - failed to load SqlMapClient [junit] com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Ca use: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: E rror parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.util.NoSuchElementExc eption [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.util.NoSuchElementExcept ion [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error pa rsing XPath '/sqlMap/select'. Cause: java.util.NoSuchElementException [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.util.NoSuchElementExcept ion [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.N odeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.uti l.NoSuchElementException [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.util.NoSuchElementExcept ion [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error pa rsing XPath '/sqlMap/select'. Cause: java.util.NoSuchElementException [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.util.NoSuchElementExcept ion [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error pa rsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRunti meException: Error parsing XPath '/sqlMap/select'. Cause: java.util.NoSuchElementException [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.util.NoSuchElementExcept ion [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error pa rsing XPath '/sqlMap/select'. Cause: java.util.NoSuchElementException [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.util.NoSuchElementExcept ion [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.N odeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.uti l.NoSuchElementException [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.util.NoSuchElementExcept ion [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error pa rsing XPath '/sqlMap/select'. Cause: java.util.NoSuchElementException [junit] Caused by: java.util.NoSuchElementException [junit] Caused by: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/select'. Cause: java.util.NoSuchElementExcept ion [junit] Caused by: java.util.NoSuchElementException [junit] at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigPa rser.java:81) [junit] at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientB uilder.java:62) [junit] at com.pbg.aps.dbconfig.SqlMapManager.init(SqlMapManager.java:36) [junit] at com.pbg.aps.dbconfig.SqlMapManager.getClient(SqlMapManager.java:53) [junit] at com.pbg.aps.model.junit.TestDbConfig.testGetClient(TestDbConfig.java:30) [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) [junit] at java.lang.reflect.Method.invoke(Method.java:324) [junit] at junit.framework.TestCase.runTest(TestCase.java:154)