Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 42631 invoked from network); 8 Feb 2008 21:04:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Feb 2008 21:04:14 -0000 Received: (qmail 46044 invoked by uid 500); 8 Feb 2008 21:04:05 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 46029 invoked by uid 500); 8 Feb 2008 21:04:05 -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 46018 invoked by uid 99); 8 Feb 2008 21:04:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Feb 2008 13:04:04 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jeffgbutler@gmail.com designates 72.14.204.237 as permitted sender) Received: from [72.14.204.237] (HELO qb-out-0506.google.com) (72.14.204.237) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Feb 2008 21:03:32 +0000 Received: by qb-out-0506.google.com with SMTP id c7so6839728qbc.16 for ; Fri, 08 Feb 2008 13:03:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=GzQT2LEXoUl/2eiGipELl+3aln4AISyoyI+7Mcbwucc=; b=UGgu3gtV8npQ6Sqeem2iqI913WeeLoBUczlwMBtXdxvRCQg8KbAO5H5fBMwm5msrqppyz7raJFuVu0UJFCbythgNG2Vpd/C7JItEn+Z6IcBl3CwA6mJgnlF5fpPG2FK0FPCpdh45t5RUDIyG/MzBO4tT16ftY71qyWkrEkH3JsY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=AV1EelJPKGuYGhL3gGr8sNVOm7ZAu4PJk5C2MklSLWc20Oy+QGW72YGpQ9NYXOwEGTK/CZpLibQDD8iou6CZhSKwU7xfwkjzg2iTEL5KQvkHtHuCcvwT0AM89q4kDxvmQWhWVmBiaFEHYKMaRQFaLCOJhvYaqBPJOj5OcYLNVfc= Received: by 10.114.93.17 with SMTP id q17mr5689925wab.70.1202504617528; Fri, 08 Feb 2008 13:03:37 -0800 (PST) Received: by 10.114.234.13 with HTTP; Fri, 8 Feb 2008 13:03:37 -0800 (PST) Message-ID: Date: Fri, 8 Feb 2008 15:03:37 -0600 From: "Jeff Butler" To: user-java@ibatis.apache.org Subject: Re: Exception "XMLType mapping only supported for Oracle RDBMS" In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_36045_23580392.1202504617517" References: X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_36045_23580392.1202504617517 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline It sounds like you have an older version of iBATIS somewhere in your runtime classpath. Do a general search for ibatos JAR files, make sure there is only one and that it is the latest version. Jeff Butler On Feb 8, 2008 2:34 PM, Chetan Nayak wrote: > Jasmi and Jeff, > > I'm still facing the issue which i mentioned below in > the thread. > When i read all methods of ResultProxy class and print out on the console > ,it does not print the getRs class ,But at compile time the method is > visible to me. > When i run the application it says NoSuchMethod exception ,Any help will > be greatly appreciated. > > Thanks in advance > Chetan > > > > On 1/7/08, Jasmin_Mehta@nexweb.org wrote: > > > > > > What version of iBATIS are you using? May be you need some jar file > > update. The getResult() method did work for me as mentioned by Jeff, without > > any compilation err. I have a jar file for iBATIS 2.3.0. > > > > > > > > > > *"Chetan Nayak" * > > > > 01/07/2008 05:43 AM Please respond to > > user-java@ibatis.apache.org > > > > To > > user-java@ibatis.apache.org cc > > Subject > > Re: Exception "XMLType mapping only supported for Oracle RDBMS" > > > > > > > > > > Hi Jeff , > > > > I tried doing what you said , > > Here is the error i get now. > > > > java.lang.NoSuchMethodError: > > com.ibatis.common.jdbc.logging.ResultSetLogProxy: method > > getRs()Ljava/sql/ResultSet; not found > > at com.cerner.clm.dao.sqlmap.XMLTypeHandlerCallback.getResult ( > > XMLTypeHandlerCallback.java:62) > > at com.ibatis.sqlmap.engine.type.CustomTypeHandler.getResult( > > CustomTypeHandler.java:52) > > at > > com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getPrimitiveResultMappingValue > > (BasicResultMap.java :611) > > at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getResults( > > BasicResultMap.java:344) > > at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults( > > SqlExecutor.java:381) > > at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults( > > SqlExecutor.java:301) > > at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery( > > SqlExecutor.java:190) > > at > > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery > > (GeneralStatement.java:205) > > at > > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback > > (GeneralStatement.java:173) > > at > > com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList > > (GeneralStatement.java :123) > > at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList( > > SqlMapExecutorDelegate.java:615) > > at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList( > > SqlMapExecutorDelegate.java:589) > > at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList( > > SqlMapSessionImpl.java:118) > > at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList( > > SqlMapClientImpl.java:95) > > > > Any idea's how to solve this. > > > > > > > > Thanks > > > > Chetan > > > > > > > > > > On 12/27/07, *Jeff Butler* <*jeffgbutler@gmail.com*> > > wrote: > > Here's how to get the real resultset from a the proxied class: > > > > > > *public* Object getResult(ResultGetter getter) *throws* SQLException { > > ResultSet rs = getter.getResultSet();* > > if* (Proxy.*isProxyClass*(rs.getClass())) { > > InvocationHandler ih = Proxy. *getInvocationHandler*(rs);* > > if* (ih *instanceof* ResultSetLogProxy) { > > ResultSet realResultSet = ((ResultSetLogProxy) ih).getRs(); > > // do something here... > > } > > } > > } > > > > It's ugly - but it works. > > > > Jeff Butler > > On Dec 26, 2007 11:37 AM, <*Jasmin_Mehta@nexweb.org*> > > wrote: > > > > Jeff, > > > > I did read your posting at *http://www.mail-archive.com/user-java@ibatis.apache.org/msg06898.html > > * already > > before sending this question. I could not understand how/where do I modify > > the code to consider proxy class. > > > > My getOpaqueValue() displays *ResultSet class is: $Proxy2, *not > > ResultSetLogProxy. > > > > The program DOES WORK if I turn off logging. > > > > I tried something like this: > > > > public Object getResult(ResultGetter getter) throws SQLException { > > // if (getter.getResultSet () instanceof OracleResultSet) { > > OPAQUE opaqueValue = getOpaqueValue(getter); > > if (opaqueValue != null) { > > XMLType xmlResult = XMLType.createXML (opaqueValue); > > return xmlResult.getDOM(); > > } else { > > return null; > > } > > // } else { > > // throw new UnsupportedOperationException("XMLType mapping > > only supported for Oracle RDBMS"); > > // } > > } > > > > > > private OPAQUE getOpaqueValue(ResultGetter getter) throws > > SQLException { > > > > > > java.sql.ResultSet rs = getter.getResultSet(); > > System.out.println ("ResultSet class is: " + rs.getClass()); > > > > // ResultSetLogProxy rsProx = (ResultSetLogProxy)rs; > > OracleResultSet ors = > > (OracleResultSet)ResultSetLogProxy.newInstance(rs); //--- *THROWS > > ClassCastException* > > OPAQUE op = null; > > if (getter.getColumnName() != null) { > > op = ors.getOPAQUE(getter.getColumnName()); > > } else { > > op = ors.getOPAQUE(getter.getColumnIndex()); > > } > > return op; > > } > > > > > > Thanks > > > > > > > > *"Jeff Butler" <**jeffgbutler@gmail.com* *>* > > > > 12/26/2007 12:24 PM > > Please respond to > > * > > **user-java@ibatis.apache.org* > > > > > > To > > *user-java@ibatis.apache.org* cc > > Subject > > Re: Exception "XMLType mapping only supported for Oracle RDBMS" > > > > > > > > > > > > The code in the wiki article does not take into account the fact that > > iBATIS logging changes the normal classes to proxy classes. First thing to > > do is turn off logging to see it will work. Second thing, the code must be > > modified to account for the proxy class if logging is enabled (add another > > instanceof check for the proxy class, then unwind the embedded "real" > > class). > > > > See here for more information: > > * > > **http://www.mail-archive.com/user-java@ibatis.apache.org/msg06898.html* > > > > Jeff Butler > > > > > > > > On Dec 26, 2007 10:26 AM, < *Jasmin_Mehta@nexweb.org*> wrote: > > > > I am using code as directed in this url: * > > ** > > **http://opensource.atlassian.com/confluence/oss/display/IBATIS/XMLTypeHandlerCallback.java > > * > > > > It throw UnsupportedOperationException("XMLType mapping only supported > > for Oracle RDBMS"); > > > > I have logger set to DEBUG mode. > > > > I tried displaying class from ResultSet like : > > > > java.sql.ResultSet rs = getter.getResultSet(); > > System.out.println("ResultSet class is: " + rs.getClass()); > > > > The cosole displays > > > > [20 Dec 2007 15:15:05] DEBUG [PreparedStatement] {pstm-100001} Executing > > Statement: SELECT OTM, SEQUENCE, MESSAGETYPE, MESSAGEID, STATUS, > > PROCESSED_TIME, CREATED FROM OTM_XML > > [20 Dec 2007 15:15:05] DEBUG [PreparedStatement] {pstm-100001} > > Parameters: [] > > [20 Dec 2007 15:15:05] DEBUG [PreparedStatement] {pstm-100001} Types: [] > > [20 Dec 2007 15:15:05] DEBUG [ResultSet] {rset-100002} ResultSet * > > ResultSet class is: class $Proxy2 * > > > > I am using JDeveloper *10.1.3.1* > > > > What should I change in my code to make it working? > > > > Thanks > > > > * > > ****************************************************************************** > > * > > 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! * > > > > ****************************************************************************** > > * > > > > > > > > > ------=_Part_36045_23580392.1202504617517 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
It sounds like you have an older version of iBATIS somewhere in your runtime classpath.
 
Do a general search for ibatos JAR files, make sure there is only one and that it is the latest version.
 
Jeff Butler

On Feb 8, 2008 2:34 PM, Chetan Nayak <chetannayaks@gmail.com> wrote:
Jasmi and Jeff,
 
                    I'm still facing the issue which i mentioned below in the thread.
When i read all methods of ResultProxy class and print out on the console ,it does not print the getRs class ,But at compile time the method is visible to me.
When i run the application it says NoSuchMethod exception ,Any help will be greatly appreciated.
 
Thanks in advance
Chetan


 
On 1/7/08, Jasmin_Mehta@nexweb.org <Jasmin_Mehta@nexweb.org> wrote:

What version of iBATIS are you using? May be you need some jar file update. The getResult() method did work for me as mentioned by Jeff, without any compilation err. I have a jar file for iBATIS 2.3.0.




"Chetan Nayak" <chetannayaks@gmail.com>

01/07/2008 05:43 AM


To
user-java@ibatis.apache.org
cc
Subject
Re: Exception "XMLType mapping only supported for Oracle RDBMS"





Hi Jeff ,
 
            I tried doing what  you said ,
Here is the error i get now.

java.lang.NoSuchMethodError: com.ibatis.common.jdbc.logging.ResultSetLogProxy: method getRs()Ljava/sql/ResultSet; not found
at com.cerner.clm.dao.sqlmap.XMLTypeHandlerCallback.getResult (XMLTypeHandlerCallback.java:62)
at com.ibatis.sqlmap.engine.type.CustomTypeHandler.getResult(CustomTypeHandler.java:52)
at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getPrimitiveResultMappingValue(BasicResultMap.java :611)
at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getResults(BasicResultMap.java:344)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(SqlExecutor.java:381)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults (SqlExecutor.java:301)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:190)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java :123)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:615)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:95)

Any idea's how to solve this.

 

Thanks

Chetan

 


On 12/27/07, Jeff Butler <
jeffgbutler@gmail.com> wrote:
Here's how to get the real resultset from a the proxied class:
 

public Object getResult(ResultGetter getter) throws SQLException {
 ResultSet rs = getter.getResultSet();

 if
(Proxy.isProxyClass(rs.getClass())) {
   InvocationHandler ih = Proxy. getInvocationHandler(rs);

   if
(ih instanceof ResultSetLogProxy) {
     ResultSet realResultSet = ((ResultSetLogProxy) ih).getRs();
     // do something here...
   }
 }
}

It's ugly - but it works.

Jeff Butler

On Dec 26, 2007 11:37 AM, <Jasmin_Mehta@nexweb.org> wrote:

Jeff,


I did read your posting at
http://www.mail-archive.com/user-java@ibatis.apache.org/msg06898.html  already before sending this question. I could not understand how/where do I modify the code to consider proxy class.

My getOpaqueValue() displays ResultSet class is: $Proxy2, not ResultSetLogProxy.


The program DOES WORK if I turn off logging.


I tried something like this:


 public Object getResult(ResultGetter getter) throws SQLException {

   //    if (getter.getResultSet () instanceof OracleResultSet) {

           OPAQUE opaqueValue = getOpaqueValue(getter);

           if (opaqueValue != null) {

               XMLType xmlResult = XMLType.createXML (opaqueValue);

               return xmlResult.getDOM();

           } else {

               return null;
           }

    //   } else {

     //      throw new UnsupportedOperationException("XMLType mapping only supported for Oracle RDBMS");
     //  }

   }



   private OPAQUE getOpaqueValue(ResultGetter getter) throws SQLException {


         
         java.sql.ResultSet rs = getter.getResultSet();

         System.out.println ("ResultSet class is: " + rs.getClass());


   //       ResultSetLogProxy rsProx =  (ResultSetLogProxy)rs;
         OracleResultSet ors = (OracleResultSet)ResultSetLogProxy.newInstance(rs);         //--- THROWS ClassCastException

         OPAQUE op = null;

         if (getter.getColumnName() != null) {

             op = ors.getOPAQUE(getter.getColumnName());

         } else {

             op = ors.getOPAQUE(getter.getColumnIndex());
         }

         return op;

     }



Thanks




"Jeff Butler" <jeffgbutler@gmail.com>

12/26/2007 12:24 PM
Please respond to

user-java@ibatis.apache.org


To
user-java@ibatis.apache.org
cc
Subject
Re: Exception "XMLType mapping only supported for Oracle RDBMS"






The code in the wiki article does not take into account the fact that iBATIS logging changes the normal classes to proxy classes.  First thing to do is turn off logging to see it will work.  Second thing, the code must be modified to account for the proxy class if logging is enabled (add another instanceof check for the proxy class, then unwind the embedded "real" class).
 
See here for more information:
 

http://www.mail-archive.com/user-java@ibatis.apache.org/msg06898.html
 
Jeff Butler



On Dec 26, 2007 10:26 AM, <
Jasmin_Mehta@nexweb.org > wrote:

I am using code as directed in this url:


http://opensource.atlassian.com/confluence/oss/display/IBATIS/XMLTypeHandlerCallback.java

It throw UnsupportedOperationException("XMLType mapping only supported for Oracle RDBMS");

I have logger set to DEBUG  mode.


I tried displaying class from ResultSet like :

       java.sql.ResultSet rs = getter.getResultSet();

       System.out.println("ResultSet class is: " + rs.getClass());


The cosole displays

[20 Dec 2007 15:15:05] DEBUG [PreparedStatement] {pstm-100001} Executing Statement:         SELECT OTM, SEQUENCE, MESSAGETYPE, MESSAGEID, STATUS, PROCESSED_TIME, CREATED     FROM OTM_XML  
[20 Dec 2007 15:15:05] DEBUG [PreparedStatement] {pstm-100001} Parameters: []

[20 Dec 2007 15:15:05] DEBUG [PreparedStatement] {pstm-100001} Types: []

[20 Dec 2007 15:15:05] DEBUG [ResultSet] {rset-100002} ResultSet

ResultSet class is: class $Proxy2


I am using JDeveloper
10.1.3.1

What should I change in my code to make it working?

Thanks

******************************************************************************
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!            
******************************************************************************





------=_Part_36045_23580392.1202504617517--