1 Reply Latest reply on Jun 22, 2002 8:07 PM by David Jencks

    BC4J ClassCastException

    Roger Carl Newbie

      I am very new to JBoss but am working very hard to get Oracle Business Components deployed. I have gotten some things to work, but still experiencing some connection related issues.

      I have been some indication that this problem stems from the JDBC layer being 'wrapped'. I am not sure that JBoss wraps JDBC, but would like confirmation... Any other clues about what might be happening? Jboss version 3.0.0 to Oracle 8i.

      The stack trace I am getting is:

      09:43:00,566 ERROR [STDERR] java.lang.ClassCastException: pgi.qwbc.QwbcAppModImp
      l
      09:43:00,566 ERROR [STDERR] oracle.jbo.common.remote.PiggybackReturn pgi.qwb
      c.server.ejb.beanmanaged.QwbcAppModServer.mytest(byte[], java.lang.String)
      09:43:00,566 ERROR [STDERR] java.lang.Object java.lang.reflect.Method.invoke
      (java.lang.Object, java.lang.Object[])
      09:43:00,566 ERROR [STDERR] java.lang.Object org.jboss.ejb.StatefulSessionCo
      ntainer$ContainerInterceptor.invoke(org.jboss.invocation.Invocation)
      09:43:00,566 ERROR [STDERR] java.lang.Object org.jboss.ejb.plugins.SecurityI
      nterceptor.invoke(org.jboss.invocation.Invocation)
      09:43:00,566 ERROR [STDERR] java.lang.Object org.jboss.resource.connectionma
      nager.CachedConnectionInterceptor.invoke(org.jboss.invocation.Invocation)
      09:43:00,566 ERROR [STDERR] java.lang.Object org.jboss.ejb.plugins.AbstractT
      xInterceptor.invokeNext(boolean, org.jboss.invocation.Invocation, boolean)
      09:43:00,566 ERROR [STDERR] java.lang.Object org.jboss.ejb.plugins.AbstractT
      xInterceptorBMT.invokeNext(boolean, org.jboss.invocation.Invocation)
      09:43:00,566 ERROR [STDERR] java.lang.Object org.jboss.ejb.plugins.TxInterce
      ptorBMT.invoke(org.jboss.invocation.Invocation)
      09:43:00,566 ERROR [STDERR] java.lang.Object org.jboss.ejb.plugins.StatefulS
      essionInstanceInterceptor.invoke(org.jboss.invocation.Invocation)
      09:43:00,566 ERROR [STDERR] java.lang.Object org.jboss.ejb.plugins.LogInterc
      eptor.invoke(org.jboss.invocation.Invocation)
      09:43:00,566 ERROR [STDERR] java.lang.Object org.jboss.ejb.StatefulSessionCo
      ntainer.invoke(org.jboss.invocation.Invocation)
      09:43:00,576 ERROR [STDERR] java.lang.Object org.jboss.ejb.Container.invoke(
      java.lang.String, java.lang.Object[], java.lang.String[])
      09:43:00,576 ERROR [STDERR] java.lang.Object org.jboss.mx.server.MBeanServer
      Impl.invoke(javax.management.ObjectName, java.lang.String, java.lang.Object[], j
      ava.lang.String[])
      09:43:00,576 ERROR [STDERR] java.lang.Object org.jboss.invocation.jrmp.serve
      r.JRMPInvoker.invoke(org.jboss.invocation.Invocation)
      09:43:00,576 ERROR [STDERR] java.lang.Object java.lang.reflect.Method.invoke
      (java.lang.Object, java.lang.Object[])
      09:43:00,576 ERROR [STDERR] void sun.rmi.server.UnicastServerRef.dispatch(ja
      va.rmi.Remote, java.rmi.server.RemoteCall)
      09:43:00,576 ERROR [STDERR] java.lang.Object sun.rmi.transport.Transport$1.r
      un()
      09:43:00,576 ERROR [STDERR] java.lang.Object java.security.AccessController.
      doPrivileged(java.security.PrivilegedExceptionAction, java.security.AccessContro
      lContext)
      09:43:00,576 ERROR [STDERR] boolean sun.rmi.transport.Transport.serviceCall(
      java.rmi.server.RemoteCall)
      09:43:00,576 ERROR [STDERR] void sun.rmi.transport.tcp.TCPTransport.handleMe
      ssages(sun.rmi.transport.Connection, boolean)
      09:43:00,576 ERROR [STDERR] void sun.rmi.transport.tcp.TCPTransport$Connecti
      onHandler.run()
      09:43:00,576 ERROR [STDERR] void java.lang.Thread.run()

        • 1. Re: BC4J ClassCastException
          David Jencks Master

          If you are using the local tx jdbc wrapper, the Connections, Statements, PreparedStatements, and CallableStatements are wrapped. This is to provide the jca-required autocommit behavior. The xa wrapper does not wrap the connections but also is not jca spec compliant and does not work very well with the current XATxConnectionManager. It might work for you, though.

          If you can guarantee that you will never attempt to use a connection outside a managed transaction, you can modify the LocalManagedConnection to return an unwrapped [Oracle] connection instead of the wrapped version. You should also make associateConnection a no-op. This will work only if the Oracle stuff always closes connections before returning from ejb calls OR calling another ejb.

          Hope this helps. It's hard to tell exactly what is being cast to what from the stack trace.