Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 47836 invoked from network); 17 Nov 2006 19:24:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Nov 2006 19:24:55 -0000 Received: (qmail 13279 invoked by uid 500); 17 Nov 2006 19:25:03 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 13126 invoked by uid 500); 17 Nov 2006 19:25:03 -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 13108 invoked by uid 99); 17 Nov 2006 19:25:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Nov 2006 11:25:02 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [64.182.62.243] (HELO mail.harmonylinemusic.com) (64.182.62.243) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Nov 2006 11:24:49 -0800 Received: by mail.harmonylinemusic.com (Postfix, from userid 90) id F21867B8061; Fri, 17 Nov 2006 13:27:09 -0500 (EST) Received: from Client1 (unknown [204.9.220.36]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mail.harmonylinemusic.com (Postfix) with ESMTP id 9460B7B8062 for ; Fri, 17 Nov 2006 13:27:08 -0500 (EST) Message-ID: <2be701c70a7d$f8b6fc80$800101df@Client1> From: "Gary Griffin" To: Subject: StackOverflowError on SqlMapClientBuilder.buildSqlMapClient Date: Fri, 17 Nov 2006 14:24:13 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_2BE4_01C70A54.0E1E5CF0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on harmonylinemusic.com X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,HTML_50_60, HTML_MESSAGE autolearn=ham version=3.0.3 This is a multi-part message in MIME format. ------=_NextPart_000_2BE4_01C70A54.0E1E5CF0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi! I'm new to iBatis and am trying to implement it in some of my code = that's running in a J2EE enivronment on JBoss. Using the following code, = I get a StackOverflowError: try { // neither my SqlMapConfig file nor the example one delivered = with iBatis seems to work: String resource =3D "WEB-INF/SqlMapConfig.xml"; // the following line works: Reader configReader =3D = Resources.getResourceAsReader(resource); /* * I used this code to make sure the reading of the XML was working: StringBuffer sb =3D new StringBuffer(); BufferedReader br =3D new BufferedReader(configReader);=20 char[] cbuf =3D new char[65536]; int read_this_time =3D 0; read_this_time =3D br.read(cbuf,0,65536); sb.append(cbuf,0,read_this_time); System.out.println(sb.toString()); */ //...but this line fails:=20 SqlMapClient sqlMap =3D = SqlMapClientBuilder.buildSqlMapClient(configReader); List rowList =3D sqlMap.queryForList("getRowList", listParams); data.getRequest().setAttribute("rowlist", rowList); } catch (IOException io) { throw new RuntimeException("Error: " + io, io); } catch (SQLException se) { throw new RuntimeException("Error: " + se, se); } catch (Exception e) { throw new RuntimeException("Error: " + e, e); } The stack trace: javax.servlet.ServletException: Servlet execution threw an exception = org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter= .java:81) root cause java.lang.StackOverflowError java.lang.Object.hashCode(Native Method) java.util.Hashtable.get(Hashtable.java:336) = gnu.xml.pipeline.ValidationConsumer$ChildrenRecognizer.patchNext(Validati= onConsumer.java:1570) = gnu.xml.pipeline.ValidationConsumer$ChildrenRecognizer.patchNext(Validati= onConsumer.java:1591) = gnu.xml.pipeline.ValidationConsumer$ChildrenRecognizer.patchNext(Validati= onConsumer.java:1591) = gnu.xml.pipeline.ValidationConsumer$ChildrenRecognizer.patchNext(Validati= onConsumer.java:1591) = gnu.xml.pipeline.ValidationConsumer$ChildrenRecognizer.patchNext(Validati= onConsumer.java:1591) ... Here's the config file that came with the iBatis I have. (Build Date: 2006/08/16 19:50 Build Number: 638): If you have any idea what I might be doing wrong, please let me know. = It's as if the XML is causing a never ending loop for some reason. I = validated my XML against the DTD and it looked okay. Here's my XML. I = tried with and without lazy loading enabled: THANKS! Gary ------=_NextPart_000_2BE4_01C70A54.0E1E5CF0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi!
 
I'm new to iBatis and am trying to = implement it in=20 some of my code that's running in a J2EE enivronment on JBoss. Using the = following code, I get a StackOverflowError:
 
        try=20 {
        = // neither=20 my SqlMapConfig file nor the example one delivered with iBatis seems to=20 work:
         String = resource =3D=20 "WEB-INF/SqlMapConfig.xml";
        = // the=20 following line works:
         Reader = configReader=20 =3D Resources.getResourceAsReader(resource);
/*
 * I used = this code to=20 make sure the reading of the XML was working:
          Stri= ngBuffer=20 sb =3D new StringBuffer();
        =  BufferedReader br =3D new BufferedReader(configReader); =
 
       =20  char[] cbuf =3D new char[65536];
 
       =20  int read_this_time =3D 0;
     =20   read_this_time =3D=20 br.read(cbuf,0,65536);
     =20   sb.append(cbuf,0,read_this_time);
    =    =20  System.out.println(sb.toString());
*/
   =20     //...but this line fails:
         SqlMapClie= nt sqlMap=20 =3D SqlMapClientBuilder.buildSqlMapClient(configReader);

         List = rowList =3D=20 sqlMap.queryForList("getRowList",=20 listParams);
       =20  data.getRequest().setAttribute("rowlist",=20 rowList);
     } catch (IOException io)=20 {
         throw new=20 RuntimeException("Error: " + io, io);
     } = catch=20 (SQLException se) {
      throw new=20 RuntimeException("Error: " + se, se);
     } = catch=20 (Exception e) {
      throw new=20 RuntimeException("Error: " + e, e);
   =20  }
The stack trace:
 
javax.servlet.ServletException: = Servlet execution=20 threw an=20 exception
 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilte= r(ReplyHeaderFilter.java:81)
 
root cause
 
java.lang.StackOverflowError
 java.lang.Object.hashCode(= Native=20 Method)
 java.util.Hashtable.get(Hashtable.java:336)
 gnu= .xml.pipeline.ValidationConsumer$ChildrenRecognizer.patchNext(ValidationC= onsumer.java:1570)
 gnu.xml.pipeline.ValidationConsumer$ChildrenR= ecognizer.patchNext(ValidationConsumer.java:1591)
 gnu.xml.pipeli= ne.ValidationConsumer$ChildrenRecognizer.patchNext(ValidationConsumer.jav= a:1591)
 gnu.xml.pipeline.ValidationConsumer$ChildrenRecognizer.p= atchNext(ValidationConsumer.java:1591)
 gnu.xml.pipeline.Validati= onConsumer$ChildrenRecognizer.patchNext(ValidationConsumer.java:1591)
= ...
 
Here's the config file that came with = the iBatis I=20 have.
(Build Date: 2006/08/16 19:50 Build = Number:=20 638):
<?xml version=3D"1.0" = encoding=3D"UTF-8"=20 ?>
 
<!DOCTYPE=20 sqlMapConfig     
    PUBLIC = "-//ibatis.apache.org//DTD SQL Map Config = 2.0//EN"     =20
    "http://ibatis.= apache.org/dtd/sql-map-config-2.dtd">
 
<sqlMapConfig>
 
  <!-- Configure a built-in = transaction=20 manager.  If you're using an =
       app=20 server, you probably want to use its transaction manager=20
       and a managed datasource=20 -->
  <transactionManager type=3D"JDBC"=20 commitRequired=3D"false">
    <dataSource=20 type=3D"SIMPLE">
      <property=20 name=3D"JDBC.Driver"=20 value=3D"org.hsqldb.jdbcDriver"/>
     =20 <property name=3D"JDBC.ConnectionURL"=20 value=3D"jdbc:hsqldb:."/>
      = <property=20 name=3D"JDBC.Username" = value=3D"sa"/>
     =20 <property name=3D"JDBC.Password" = value=3D"sa"/>
   =20 </dataSource>
  </transactionManager>
 
  <!-- List the SQL Map XML = files. They=20 can be loaded from the
       = classpath, as=20 they are here (com.domain.data...) -->
  <sqlMap=20 resource=3D"com/mydomain/data/Account.xml"/>
  <!-- List = more=20 here...
  <sqlMap=20 resource=3D"com/mydomain/data/Order.xml"/>
  <sqlMap=20 resource=3D"com/mydomain/data/Documents.xml"/>
  = -->
 
</sqlMapConfig>
If you have any idea what I might be = doing wrong,=20 please let me know. It's as if the XML is causing a never ending loop = for some=20 reason. I validated my XML against the DTD and it looked okay. Here's my = XML. I=20 tried with and without lazy loading enabled:
 
<?xml version=3D"1.0" = encoding=3D"UTF-8"=20 ?>
 
<!DOCTYPE=20 sqlMapConfig     
    PUBLIC = "-//ibatis.apache.org//DTD SQL Map Config = 2.0//EN"     =20
    "http://ibatis.= apache.org/dtd/sql-map-config-2.dtd">
 
<sqlMapConfig>
 
<!--  <settings=20 useStatementNamespaces=3D"false" /> -->
 <settings=20 lazyLoadingEnabled=3D"false" />
    = <transactionManager=20 type=3D"JDBC" >
        = <dataSource=20 type=3D"JNDI">
        &nbs= p;  =20 <property name=3D"DataSource"=20 value=3D"java:comp/env/jdbc/qcsql"/>
     =   =20 </dataSource>
   =20 </transactionManager>
 
    <sqlMap=20 resource=3D"RowList.xml"/>
</sqlMapConfig>
 
THANKS!
Gary
------=_NextPart_000_2BE4_01C70A54.0E1E5CF0--