Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-9470

JDBC statement.getConnection() fails from org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.doStatementMethod

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • EAP_EWP 5.2.0
    • EAP_EWP 5.1.2
    • JCA
    • None
    • Release Notes
    • Hide
      The <systemitem>org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.doStatementMethod</systemitem> method did not return a proxied connection. Consequently, when the <systemitem>statement.getConnection()</systemitem> JDBC API method was called from an application, the following exception was thrown:

      <screen>
      Caused by: java.lang.IllegalAccessException: Method=public abstract java.sql.Connection java.sql.Statement.getConnection() throws java.sql.SQLException does not return Serializable
      at org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.doStatementMethod(WrapperDataSourceService.java:422)
      at org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.invoke(WrapperDataSourceService.java:227)
      at sun.reflect.GeneratedMethodAccessor165.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      </screen>

      With this update, a proxied connection is returned, which eliminates the above mentioned exception and enables successful calls of the <systemitem>statement.getConnection()</systemitem> method.
      Show
      The <systemitem>org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.doStatementMethod</systemitem> method did not return a proxied connection. Consequently, when the <systemitem>statement.getConnection()</systemitem> JDBC API method was called from an application, the following exception was thrown: <screen> Caused by: java.lang.IllegalAccessException: Method=public abstract java.sql.Connection java.sql.Statement.getConnection() throws java.sql.SQLException does not return Serializable at org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.doStatementMethod(WrapperDataSourceService.java:422) at org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.invoke(WrapperDataSourceService.java:227) at sun.reflect.GeneratedMethodAccessor165.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) </screen> With this update, a proxied connection is returned, which eliminates the above mentioned exception and enables successful calls of the <systemitem>statement.getConnection()</systemitem> method.
    • Documented as Resolved Issue
    • NEW

      When JDBC API statement.getConnection() is called from an application (in this case a standalone app), the following stack trace is encountered:

      Caused by: java.lang.IllegalAccessException: Method=public abstract java.sql.Connection java.sql.Statement.getConnection() throws java.sql.SQLException does not return Serializable
      at org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.doStatementMethod(WrapperDataSourceService.java:422)
      at org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.invoke(WrapperDataSourceService.java:227)
      at sun.reflect.GeneratedMethodAccessor165.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      Looking at org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService code in method "doStatementMethod", it does not return a proxied connection. A proxied connection should be returned like the following:

      if( value instanceof Connection )
      {
      value = createConnectionProxy(value);
      }

              jeff.zhang_jira Jeff Zhang (Inactive)
              rhn-support-dchia David Chia (Inactive)
              Petr Penicka Petr Penicka (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: