Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 8010 invoked from network); 3 Jul 2006 17:42:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Jul 2006 17:42:45 -0000 Received: (qmail 97369 invoked by uid 500); 3 Jul 2006 17:42:43 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 97349 invoked by uid 500); 3 Jul 2006 17:42:43 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 97338 invoked by uid 99); 3 Jul 2006 17:42:42 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 10:42:42 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.247.21.92] (HELO wis.nl) (83.247.21.92) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2006 10:42:42 -0700 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: error parsing xml files X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Date: Mon, 3 Jul 2006 19:42:13 +0200 Message-ID: <50CA25BD6EEA954FA592C097399942E313A8065C@CM1.wis.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: error parsing xml files thread-index: AcaevaRXmGPBEmapT9epgRaiH3j6cQACiCqg From: "Niels Beekman" To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Look more closely to the example Jeff posted, the DAO manager links a DAO-interface to a concrete implementation (see interface and implementation attributes in the DAO config). Something like: OdmLinkDAO linkDao =3D (OdmLinkDAO)daoManager.getDao(OdmLinkDAO.class); Niels -----Original Message----- From: Thomas Karl Schwaerzler [mailto:Thomas.Schwaerzler@student.uibk.ac.at]=20 Sent: maandag 3 juli 2006 18:28 To: Jeff Butler Cc: user-java@ibatis.apache.org Subject: Re: error parsing xml files now i tried this: OdmLinkDAOImpl linkDao =3D=20 (OdmLinkDAOImpl)daoManager.getDao(OdmLinkDAOImpl.class); the error i get doesnt really give me a clue: Exception in thread "main" com.ibatis.dao.client.DaoException: There is no=20 DAO implementation found for class=20 org.dea.odm.model.dao.test.dao.OdmLinkDAOImpl in this context. at=20 com.ibatis.dao.engine.impl.DaoContext.getDao(DaoContext.java:75) at=20 com.ibatis.dao.engine.impl.StandardDaoManager.getDao(StandardDaoManager. java:76) at=20 org.dea.odm.model.dao.test.OdmLinkDAOImplTest.test(OdmLinkDAOImplTest.ja va:52) at=20 org.dea.odm.model.dao.test.OdmLinkDAOImplTest.main(OdmLinkDAOImplTest.ja va:21) dao.config: SqlMapConfigAbator.xml: ..if i had to guess, i'd guess its something in the config files... thanks for your patient help t. On Mon, 3 Jul 2006, Jeff Butler wrote: > Are you using the DAO manager to get the dao, or are you trying to create > the DAO impl class yourself? You should have code like this somewhere: > > OdmLinkDAO linkDao =3D daoManager.getDao(OdmLinkDAO.class); > > You should NOT have this: > > OdmLinkDAOImpl linkDao =3D new OdmLinkDAOImpl(daoManager); > > Jeff Butler > > > > > > > > On 7/3/06, Thomas Karl Schwaerzler > wrote: >>=20 >>=20 >> thanks. >> indeed it was a namespace problem. >> adding this line solved my problem. >>=20 >> but now i get another error when calling a dao method: >>=20 >> >> OdmLinkExample ole =3D new OdmLinkExample(); >> ole.setWorkflowId(new BigDecimal(1)); >>=20 >> ole.setWorkflowId_Indicator(OdmLinkExample.EXAMPLE_EQUALS); >> //ole.setActionId(new BigDecimal(12)); >>=20 >> //ole.setActionId_Indicator(OdmLinkExample.EXAMPLE_EQUALS); >> >> System.out.println("select:"); >> >> // THIS LINE CAUSES THE ERROR >> linkDao.selectByExample(ole); >>=20 >>=20 >>=20 >> Exception in thread "main" java.lang.NullPointerException >> at >> com.ibatis.dao.engine.impl.StandardDaoManager.getTransaction( >> StandardDaoManager.java:108) >> at >> com.ibatis.dao.client.template.SqlMapDaoTemplate.getSqlMapExecutor( >> SqlMapDaoTemplate.java:60) >> at >> com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForList( >> SqlMapDaoTemplate.java:203) >> at >> org.dea.odm.model.dao.test.dao.OdmLinkDAOImpl.selectByExample( >> OdmLinkDAOImpl.java:59) >> at >> org.dea.odm.model.dao.test.dao.OdmLinkDAOImpl.selectByExample( >> OdmLinkDAOImpl.java:71) >> at >> org.dea.odm.model.dao.test.OdmLinkDAOImplTest.test(OdmLinkDAOImplTest.ja va >> :66) >> at >> org.dea.odm.model.dao.test.OdmLinkDAOImplTest.main(OdmLinkDAOImplTest.ja va >> :22) >>=20 >>=20 >>=20 >> in this method OdmLinkDAOImpl.java: >> >> /** >> * This method was generated by Abator for iBATIS. >> * This method corresponds to the database table c108272dev.ODM_LINK >> * >> * @abatorgenerated Mon Jul 03 16:07:30 CEST 2006 >> */ >> public List selectByExample(OdmLinkExample example) { >> return selectByExample(example, null); // HERE... >> } >>=20 >>=20 >>=20 >> On Mon, 3 Jul 2006, Graeme J Sweeney wrote: >>=20 >> > On Mon, 3 Jul 2006, Thomas Karl Schwaerzler wrote: >> > >> >> com.ibatis.common.exception.NestedRuntimeException: Could not find SQL >> >> statement to include with refid >> >> 'user_ODM_LINK.abatorgenerated_Example_Where_Clause' >> > >> > Is it a namespace issue? >> > >> > >> > >> >> here my SqlMapConfigAbator.xml >> >> >> >> >> >> >> >> > >> PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN" >> >> "http://www.ibatis.com/dtd/sql-map-config-2.dtd"> >> >> >> >> >> > >> > Add this: >> > >> > >> > >> >> > >> >> resource=3D"org/dea/odm/model/dao/test/sqlmap/c108272dev_ODM_LINK_SqlMap.= x ml" >> >> /> >> >> >> > >> > -- >> > Graeme - >> > >>=20 >>=20 >> thanks >> t. >>=20 >