Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 13221 invoked from network); 4 Jan 2008 15:06:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Jan 2008 15:06:33 -0000 Received: (qmail 79908 invoked by uid 500); 4 Jan 2008 15:06:21 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 79286 invoked by uid 500); 4 Jan 2008 15:06:20 -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 79275 invoked by uid 99); 4 Jan 2008 15:06:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jan 2008 07:06:20 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [63.249.95.37] (HELO mail.cruzio.com) (63.249.95.37) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jan 2008 15:06:07 +0000 Received: from [192.168.0.103] (dsl-63-249-97-217.cruzio.com [63.249.97.217]) by mail.cruzio.com with ESMTP id m04F5wmi082561 for ; Fri, 4 Jan 2008 07:05:58 -0800 (PST) Message-ID: <477E4BC0.9040300@cruzio.com> Date: Fri, 04 Jan 2008 07:07:44 -0800 From: Richard Yee User-Agent: Thunderbird 1.4 (Windows/20050908) MIME-Version: 1.0 To: user-java@ibatis.apache.org Subject: Re: Converting iBATIS DAO to Spring DAO in non-web application References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org You don't need to create a web\WEB-INF folder to use Spring. Look at using a GenericApplicationContext and a XmlBeanDefinitionReader. Look at the BeanFactory interface in the Spring documentation -Richard Jasmin_Mehta@nexweb.org wrote: > > Hi, > > I want to convert my iBATIS DAO to Spring DAO. My Java project is not > web project. But its application running using class that has main() > method. So in order to use Spring DAO, I had to specially create > web\WEB-INF folder and add web.xml file, spring.xml file to it. > > _web.xml has below content:_ > > > Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> > > web.xml file for OTM Web Application > > contextConfigLocation > /WEB-INF/spring.xml > > > > > org.springframework.web.context.ContextLoaderListener > > > > > > org.nexweb.otm.spring.listeners.SpringInit > > > > > _spring.xml has below content:_ > > > "http://www.springframework.org/dtd/spring-beans.dtd"> > > class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> > > > > class="org.apache.commons.dbcp.BasicDataSource"> > > > > > > class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> > > > classpath:org/nexweb/otm/ibatis/config/SqlMapConfig.xml > > > true > > > > > > class="org.springframework.orm.ibatis.SqlMapClientTemplate"> > > > > > > class="org.nexweb.otm.ibatis.dao.sqlmaps.GLogXMLSqlMapDAO"> > > > > > > class="org.nexweb.otm.ibatis.services.XmlService"> > > > > > > I also added SpringInit.java file as shown in > http://opensource.atlassian.com/confluence/oss/display/IBATIS/Converting+iBATIS+DAO+to+Spring+DAO. > > > *Now, when I invoke SpringInit.getApplicationContext() method, its > returning me 'null'. The application is not calling > contextInitialized() when I run it thru the main() method call.* > > *What should I do to set WebApplicationContext springContext ?* > > Thanks > Jasmin > > ******************************************************************************* > *ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION > Our domain name is changing. Please take note of the sender's > e-Mail address and make changes to your personal address list, > if needed. Both domains will continue to work, only for a limited > time. > ****************************************************************************** > This email and any files transmitted with it are intended solely for > the use of the individual or agency to whom they are addressed. > If you have received this email in error please notify the Navy > Exchange Service Command e-mail administrator. This footnote > also confirms that this email message has been scanned for the > presence of computer viruses. > > Thank You! > ******************************************************************************** >