0 Replies Latest reply on Jan 23, 2009 8:53 AM by John Eric Hamacher

    ClassCastException with Oracle 10g

    John Eric Hamacher Newbie

      Hello:

      I need to configure jBoss to use Oracle but I don't want to tie my code to JBoss.

      I am getting the following stack trace at this line:

      ArrayDescriptor codeNameValueObjectDescriptor = ArrayDescriptor.createDescriptor("NAME_VALUE_OBJ_TAB", conn);

      Stack Trace:

      java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.WrappedConnection
      09:16:44,361 ERROR [STDERR] at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:103)
      09:16:44,361 ERROR [STDERR] at survey.db.SurveyDB.callGet_codeRef(SurveyDB.java:1189)
      09:16:44,361 ERROR [STDERR] at util.LoadDropdownListener.loadAllCodes(LoadDropdownListener.java:136)
      09:16:44,361 ERROR [STDERR] at util.LoadDropdownListener.contextInitialized(LoadDropdownListener.java:78)
      09:16:44,361 ERROR [STDERR] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
      09:16:44,361 ERROR [STDERR] at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
      09:16:44,361 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
      09:16:44,361 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
      09:16:44,361 ERROR [STDERR] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
      09:16:44,361 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      09:16:44,361 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      09:16:44,361 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:16:44,361 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      09:16:44,361 ERROR [STDERR] at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:16:44,361 ERROR [STDERR] at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052)
      09:16:44,361 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      09:16:44,361 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      09:16:44,361 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:16:44,361 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      09:16:44,361 ERROR [STDERR] at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:16:44,361 ERROR [STDERR] at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297)
      09:16:44,361 ERROR [STDERR] at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
      09:16:44,361 ERROR [STDERR] at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
      09:16:44,361 ERROR [STDERR] at org.jboss.web.WebModule.startModule(WebModule.java:83)
      09:16:44,361 ERROR [STDERR] at org.jboss.web.WebModule.startService(WebModule.java:61)
      09:16:44,361 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      09:16:44,361 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      09:16:44,361 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
      09:16:44,361 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:16:44,361 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:16:44,361 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      09:16:44,361 ERROR [STDERR] at $Proxy0.start(Unknown Source)
      09:16:44,361 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:417)
      09:16:44,361 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      09:16:44,361 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:16:44,361 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      09:16:44,361 ERROR [STDERR] at $Proxy38.start(Unknown Source)
      09:16:44,361 ERROR [STDERR] at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
      09:16:44,361 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      09:16:44,361 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      09:16:44,361 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:16:44,361 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      09:16:44,361 ERROR [STDERR] at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
      09:16:44,361 ERROR [STDERR] at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
      09:16:44,361 ERROR [STDERR] at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
      09:16:44,361 ERROR [STDERR] at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      09:16:44,361 ERROR [STDERR] at $Proxy39.start(Unknown Source)
      09:16:44,361 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      09:16:44,361 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      09:16:44,361 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      09:16:44,361 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
      09:16:44,361 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:16:44,361 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:16:44,361 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      09:16:44,361 ERROR [STDERR] at $Proxy8.deploy(Unknown Source)
      09:16:44,361 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      09:16:44,361 ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
      09:16:44,361 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      09:16:44,377 ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
      09:16:44,377 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      09:16:44,377 ERROR [STDERR] at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      09:16:44,377 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      09:16:44,377 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      09:16:44,377 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:16:44,377 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:16:44,377 ERROR [STDERR] at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      09:16:44,377 ERROR [STDERR] at $Proxy0.start(Unknown Source)
      09:16:44,377 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:417)
      09:16:44,377 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      09:16:44,377 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:16:44,377 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      09:16:44,377 ERROR [STDERR] at $Proxy4.start(Unknown Source)
      09:16:44,377 ERROR [STDERR] at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
      09:16:44,377 ERROR [STDERR] at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      09:16:44,377 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      09:16:44,377 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      09:16:44,377 ERROR [STDERR] at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
      09:16:44,377 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      09:16:44,377 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      09:16:44,377 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:16:44,377 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:16:44,377 ERROR [STDERR] at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      09:16:44,377 ERROR [STDERR] at $Proxy5.deploy(Unknown Source)
      09:16:44,377 ERROR [STDERR] at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
      09:16:44,377 ERROR [STDERR] at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
      09:16:44,377 ERROR [STDERR] at org.jboss.Main.boot(Main.java:200)
      09:16:44,377 ERROR [STDERR] at org.jboss.Main$1.run(Main.java:490)
      09:16:44,377 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)


      I am trying to run jBoss 4.0.5 for the first time with Oracle 10g. I seem to get the Connection alright:

      Context context = new InitialContext();
      DataSource pds = null;
      pds = (DataSource)context.lookup(name);
      context.close();
      return pds.getConnection();

      I am using ojdbc14dms.jar and dms.jar. Here is my oracle-ds.xml:


      <local-tx-datasource>
      <jndi-name>GFDataSource</jndi-name>
      <connection-url>jdbc:oracle:thin:@someserver:9999:DB</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>username</user-name>
      password
      <min-pool-size>2</min-pool-size>
      <max-pool-size>20</max-pool-size>
      <idle-timeout-minutes>0</idle-timeout-minutes>
      <prepared-statement-cache-size>32</prepared-statement-cache-size>
      </local-tx-datasource>