[jboss-cvs] JBossAS SVN: r64963 - trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 30 07:14:01 EDT 2007


Author: adrian at jboss.org
Date: 2007-08-30 07:14:01 -0400 (Thu, 30 Aug 2007)
New Revision: 64963

Modified:
   trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCResultSetReader.java
Log:
Improve the error message

Modified: trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCResultSetReader.java
===================================================================
--- trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCResultSetReader.java	2007-08-30 09:40:21 UTC (rev 64962)
+++ trunk/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCResultSetReader.java	2007-08-30 11:14:01 UTC (rev 64963)
@@ -21,19 +21,21 @@
 */
 package org.jboss.ejb.plugins.cmp.jdbc;
 
-import org.jboss.logging.Logger;
-
-import javax.ejb.Handle;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.rmi.MarshalledObject;
+import java.rmi.RemoteException;
+import java.sql.Blob;
+import java.sql.Clob;
 import java.sql.ResultSet;
 import java.sql.SQLException;
-import java.sql.Clob;
-import java.sql.Blob;
-import java.rmi.MarshalledObject;
-import java.rmi.RemoteException;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.InputStream;
+import java.util.Arrays;
 
+import javax.ejb.Handle;
+
+import org.jboss.logging.Logger;
+
 /**
  * Implementations of this interface are used to read java.sql.ResultSet.
  *
@@ -533,11 +535,19 @@
             }
 
             // oops got the wrong type - nothing we can do
-            throw new SQLException("Got a " + value.getClass().getName() + "[cl=" +
-               System.identityHashCode(value.getClass().getClassLoader()) +
-               ", value=" + value + "] while looking for a " +
-               destination.getName() + "[cl=" +
-               System.identityHashCode(destination) + "]");
+            String className = null;
+            Object interfaces = null;
+            ClassLoader cl = null;
+            if (value != null)
+            {
+               Class valueClass = value.getClass();
+               className = valueClass.getName();
+               interfaces = Arrays.asList(valueClass.getInterfaces());
+               cl = valueClass.getClassLoader();
+            }
+            throw new SQLException("Got a " + className + "[cl=" + cl +
+               " + interfaces=" + interfaces + ", value=" + value + "] while looking for a " +
+               destination.getName() + "[cl=" + destination.getClassLoader() + "]");
          }
          catch(RemoteException e)
          {




More information about the jboss-cvs-commits mailing list