6 Replies Latest reply on Apr 23, 2007 1:51 PM by mhammam

    WrappedResultSet cast excpetion

    mhammam

      Hi all;

      When i want to cast WrappedResultSet to OracleConnection i have the following error :

      -----------------------------------------------------------
      java.lang.UnsupportedOperationException: Do not know how to handle method=public abstract long java.sql.Blob.length() throws java.sql.SQLException
      at org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.invoke(WrapperDataSourceService.java:247)
      at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
      at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
      at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
      at $Proxy62.length(Unknown Source)
      ------------------------------
      thank's for your help;

        • 1. Re: WrappedResultSet cast excpetion
          weston.price

          You wouldn't do a cast you need to call the

          getUnderlyingResultSet()
          


          on the WrappedResult set.



          • 2. Re: WrappedResultSet cast excpetion
            mhammam

            Yes i was do that,

            But always the same problem, my question is : is there any specific configuration to use oracle db under JBoss ?

            where Jboss retreive the oracle driver and classes (ResultSet, Oracle Connection, ...), becuase when i delete oracle-9.2.0.3-ojdbc14.jar from my application, the application was successfuly loaded ? why ?

            Thank's.

            • 3. Re: WrappedResultSet cast excpetion
              weston.price

              Could you clarify your last question? I am not sure what you are asking.

              • 4. Re: WrappedResultSet cast excpetion
                mhammam

                Where is located the jar file that contains oracle driver ?

                • 5. Re: WrappedResultSet cast excpetion
                  weston.price

                  Ok, looking a bit closer what I think you are asking is where JBoss gets the Oracle specific driver classes from. Typically you place this in your server/lib directory and it is available server wide. If another application is using a different version of those classes, or contains these classes as part of another application deployment you will receive a ClassCastException. More on this can be found here:

                  http://wiki.jboss.org/wiki/Wiki.jsp?page=IWantToDeployMyOwnJdbcDriverInAScopedClassloader

                  • 6. Re: WrappedResultSet cast excpetion
                    mhammam

                    Weston,

                    When i don't add the jboss-common-jdbc-wrapper.jar in myapplication/lib directory, my application was successfly loaded.

                    But when i add it, the following error was shown :

                    java.lang.UnsupportedOperationException: Do not know how to handle method=public abstract long java.sql.Blob.length() throws java.sql.SQLException
                    at org.jboss.resource.adapter.jdbc.remote.WrapperDataSourceService.invoke(WrapperDataSourceService.java:247)
                    at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:585)
                    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                    at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                    at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
                    at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
                    at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
                    at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
                    at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
                    at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
                    at $Proxy62.length(Unknown Source)

                    and my code is :

                    final Blob blob = rs.getBlob(names[0]);
                    return blob != null ? blob.getBytes(1, (int) blob.length()) : null;