Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 9955 invoked from network); 19 Jun 2006 14:25:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Jun 2006 14:25:11 -0000 Received: (qmail 19193 invoked by uid 500); 19 Jun 2006 14:25:06 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 19176 invoked by uid 500); 19 Jun 2006 14:25:06 -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 18932 invoked by uid 99); 19 Jun 2006 14:25:04 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jun 2006 07:25:04 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jeffgbutler@gmail.com designates 66.249.92.168 as permitted sender) Received: from [66.249.92.168] (HELO ug-out-1314.google.com) (66.249.92.168) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Jun 2006 07:25:01 -0700 Received: by ug-out-1314.google.com with SMTP id k3so2722068ugf for ; Mon, 19 Jun 2006 07:24:39 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=JgKRM9p9F4Gix+sJuOYZeIGZ5Mf8tx2tQSLsx6eng8npgDC/pvtblYcllSdLmsUl1WMkHFsleDiObl8PdN7ByKM0MgTEBcTBRoy/WQhnmtNNSX0qlL4cAZ1i6IUYHMrLBFN4HNxA1WTNtVY1Inw6x4KE5vLF01DS/EMCeM46ScU= Received: by 10.67.100.17 with SMTP id c17mr4352158ugm; Mon, 19 Jun 2006 07:24:39 -0700 (PDT) Received: by 10.66.238.18 with HTTP; Mon, 19 Jun 2006 07:24:39 -0700 (PDT) Message-ID: Date: Mon, 19 Jun 2006 09:24:39 -0500 From: "Jeff Butler" To: user-java@ibatis.apache.org Subject: Re: Ibatis DAO XML problem In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8547_10355487.1150727079347" References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_8547_10355487.1150727079347 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline The cause of error is "connection refused". This implies that there is something wrong with your database connection settings. Other things I noticed (these are not causing your error, but could cause other errors): 1. You need to specify useStatementNamespaces="true". You'll not get far with Abator if you disable namespaces. 2. The DOCTYPE declaration is wrong - please see the iBATIS home page for the new DOCTYPE declarations. Jeff Butler On 6/19/06, Cristiano Monteiro dos Santos wrote: > > Hi there! > > I'm new to iBATIS and I'm having problem on executing JUnit tests. I'm > using > Abator for some code generation for a simple CRUD app I have to build. > I've > mapped all the abator's xml in the SqlMapConfig.xml, like this: > > > "http://www.ibatis.com/dtd/sql-map-config-2.dtd"> > > > > > > lazyLoadingEnabled="true" maxRequests="32" maxSessions="10" > maxTransactions="5" useStatementNamespaces="false" /> > > > > > > > /> > /> > /> > > > > > resource="br/com/polimed/ibatis/polimed4/model/informix_tbcartaocategoria_Sq > lMap.xml" /> > > resource="br/com/polimed/ibatis/polimed4/model/informix_tbcartaoespec_SqlMap > .xml" /> > > resource="br/com/polimed/ibatis/polimed4/model/informix_tbespecialidade_SqlM > ap.xml" /> > > > > But as I try to configure my DAO like this: > Reader reader = Resources.getResourceAsReader( "SqlMapConfig.xml" ); > Tb301autogeradoDAO dao = new Tb301autogeradoDAOImpl( > DaoManagerBuilder.buildDaoManager( reader ) ); > > I receive this error: > > com.ibatis.dao.client.DaoException: Error while configuring DaoManager. > Cause: com.ibatis.common.exception.NestedRuntimeException: XML Parser > Error. > Cause: java.net.ConnectException: Connection refused: connect > Caused by: com.ibatis.common.exception.NestedRuntimeException: XML Parser > Error. Cause: java.net.ConnectException: Connection refused: connect > at > com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager > (XmlDa > oManagerBuilder.java:129) > at > com.ibatis.dao.client.DaoManagerBuilder.buildDaoManager( > DaoManagerBuilder.ja > va:59) > at > br.com.polimed.ibatis.sim.dao.Tb301autogeradoDAOImplTest.setUp > (Tb301autogera > doDAOImplTest.java:17) > at junit.framework.TestCase.runBare(TestCase.java:125) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:118) > at junit.framework.TestSuite.runTest(TestSuite.java:208) > at junit.framework.TestSuite.run(TestSuite.java:203) > at > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run > (JUnit3T > estReference.java:128) > at > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java > :3 > 8) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests > (RemoteTestRu > nner.java:460) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests > (RemoteTestRu > nner.java:673) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run > (RemoteTestRunner. > java:386) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main > (RemoteTestRunner > .java:196) > Caused by: com.ibatis.common.exception.NestedRuntimeException: XML Parser > Error. Cause: java.net.ConnectException: Connection refused: connect > at > com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.getDoc > (XmlDaoManagerB > uilder.java:320) > at > com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager > (XmlDa > oManagerBuilder.java:88) > ... 15 more > > Caused by: > com.ibatis.common.exception.NestedRuntimeException: XML Parser Error. > Cause: java.net.ConnectException: Connection refused: connect > at > com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.getDoc > (XmlDaoManagerB > uilder.java:320) > at > com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager > (XmlDa > oManagerBuilder.java:88) > at > com.ibatis.dao.client.DaoManagerBuilder.buildDaoManager( > DaoManagerBuilder.ja > va:59) > at > br.com.polimed.ibatis.sim.dao.Tb301autogeradoDAOImplTest.setUp > (Tb301autogera > doDAOImplTest.java:17) > at junit.framework.TestCase.runBare(TestCase.java:125) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:118) > at junit.framework.TestSuite.runTest(TestSuite.java:208) > at junit.framework.TestSuite.run(TestSuite.java:203) > at > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run > (JUnit3T > estReference.java:128) > at > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java > :3 > 8) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests > (RemoteTestRu > nner.java:460) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests > (RemoteTestRu > nner.java:673) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run > (RemoteTestRunner. > java:386) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main > (RemoteTestRunner > .java:196) > > > Any idea of what's happening? I've already searched Google and Jira for > those, with no concrete answer. > > TIA! > > Regards, > Cristiano > ------=_Part_8547_10355487.1150727079347 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
The cause of error is "connection refused". This implies that there is something wrong with your database connection settings.
 
Other things I noticed (these are not causing your error, but could cause other errors):
 
1. You need to specify useStatementNamespaces="true".  You'll not get far with Abator if you disable namespaces.
 
2. The DOCTYPE declaration is wrong - please see the iBATIS home page for the new DOCTYPE declarations.
 
Jeff Butler

 
On 6/19/06, Cristiano Monteiro dos Santos <csantos@polimed.com.br> wrote:
Hi there!

I'm new to iBATIS and I'm having problem on executing JUnit tests. I'm using
Abator for some code generation for a simple CRUD app I have to build. I've
mapped all the abator's xml in the SqlMapConfig.xml, like this:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
"http://www.ibatis.com/dtd/sql-map-config-2.dtd">

<sqlMapConfig>

       <properties resource="SqlMapConfig.properties " />

       <settings cacheModelsEnabled="true" enhancementEnabled="true"
               lazyLoadingEnabled="true" maxRequests="32" maxSessions="10"
               maxTransactions="5" useStatementNamespaces="false" />

       <typeAlias alias="order" type="testdomain.Order" />

       <transactionManager type="JDBC">
               <dataSource type="SIMPLE">
                       <property name="JDBC.Driver" value="${driver}" />
                       <property name="JDBC.ConnectionURL " value="${url}"
/>
                       <property name="JDBC.Username" value="${username}"
/>
                       <property name="JDBC.Password" value="${password}"
/>
               </dataSource>
       </transactionManager>

       <sqlMap
resource="br/com/polimed/ibatis/polimed4/model/informix_tbcartaocategoria_Sq
lMap.xml" />
       <sqlMap
resource="br/com/polimed/ibatis/polimed4/model/informix_tbcartaoespec_SqlMap
.xml" />
       <sqlMap
resource="br/com/polimed/ibatis/polimed4/model/informix_tbespecialidade_SqlM
ap.xml" />

</sqlMapConfig>

But as I try to configure my DAO like this:
Reader reader = Resources.getResourceAsReader( "SqlMapConfig.xml" );
Tb301autogeradoDAO dao = new Tb301autogeradoDAOImpl(
DaoManagerBuilder.buildDaoManager( reader ) );

I receive this error:

com.ibatis.dao.client.DaoException: Error while configuring DaoManager.
Cause: com.ibatis.common.exception.NestedRuntimeException: XML Parser Error.
Cause: java.net.ConnectException: Connection refused: connect
Caused by: com.ibatis.common.exception.NestedRuntimeException: XML Parser
Error.  Cause: java.net.ConnectException: Connection refused: connect
       at
com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager(XmlDa
oManagerBuilder.java:129)
       at
com.ibatis.dao.client.DaoManagerBuilder.buildDaoManager(DaoManagerBuilder.ja
va:59)
       at
br.com.polimed.ibatis.sim.dao.Tb301autogeradoDAOImplTest.setUp(Tb301autogera
doDAOImplTest.java:17)
       at junit.framework.TestCase.runBare(TestCase.java:125)
       at junit.framework.TestResult$1.protect (TestResult.java:106)
       at junit.framework.TestResult.runProtected(TestResult.java:124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at junit.framework.TestSuite.runTest(TestSuite.java:208)
       at junit.framework.TestSuite.run(TestSuite.java:203)
       at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3T
estReference.java:128)
       at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:3
8)
       at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:460)
       at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:673)
       at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:386)
       at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:196)
Caused by: com.ibatis.common.exception.NestedRuntimeException: XML Parser
Error.  Cause: java.net.ConnectException : Connection refused: connect
       at
com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.getDoc(XmlDaoManagerB
uilder.java:320)
       at
com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager (XmlDa
oManagerBuilder.java:88)
       ... 15 more

Caused by:
com.ibatis.common.exception.NestedRuntimeException: XML Parser Error.
Cause: java.net.ConnectException: Connection refused: connect
       at
com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.getDoc(XmlDaoManagerB
uilder.java:320)
       at
com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager(XmlDa
oManagerBuilder.java:88)
       at
com.ibatis.dao.client.DaoManagerBuilder.buildDaoManager(DaoManagerBuilder.ja
va:59)
       at
br.com.polimed.ibatis.sim.dao.Tb301autogeradoDAOImplTest.setUp(Tb301autogera
doDAOImplTest.java:17)
       at junit.framework.TestCase.runBare(TestCase.java:125)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
       at junit.framework.TestResult.runProtected(TestResult.java:124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at junit.framework.TestSuite.runTest(TestSuite.java:208)
       at junit.framework.TestSuite.run (TestSuite.java:203)
       at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3T
estReference.java:128)
       at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java :3
8)
       at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:460)
       at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java :673)
       at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:386)
       at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:196)


Any idea of what's happening? I've already searched Google and Jira for
those, with no concrete answer.

TIA!

Regards,
Cristiano

------=_Part_8547_10355487.1150727079347--