ClassCastException thrown from oracle.sql.ArrayDescriptor - SUN

This is a discussion on ClassCastException thrown from oracle.sql.ArrayDescriptor - SUN ; I have a very strange error. I can't seen to create an oracle.java.ArrayDescriptor in my app when I run it on Sun Java Web Server 6.1. I can run this identical code on an Oracle Application Server 10g with no ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: ClassCastException thrown from oracle.sql.ArrayDescriptor

  1. ClassCastException thrown from oracle.sql.ArrayDescriptor

    I have a very strange error. I can't seen to create an
    oracle.java.ArrayDescriptor in my app when I run it on Sun Java Web
    Server 6.1. I can run this identical code on an Oracle Application
    Server 10g with no problems.

    A little info from investigation.
    The connection passed into the ArrayDescriptor is
    com.sun.enterprise.resource.JdbcConnection. This gets cast into a
    java.sql.Connection. It appears good. See code snippet. The
    ClassCastException happens right after the call to
    ArrayDescriptor.createDescriptor. It's almost like ArrayDescriptor
    can't handle the connection being passed to it. What's really odd is
    none of this happens on OAS. The connection on OAS is
    com.evermind.sql.OrclCMTConnection.

    Also in Sun it specifies an OracleDataSource will be created from the
    JDBC Connection Pools listing, yet it actually creates a
    com.sun.enterprise.resource.JdbcDataSource. With OAS I use the Orion
    DataSource and have to configure it a bit differently, but produces a
    com.evermind.sql.OrionCMTDataSource.

    code snippet
    DataSource ds =
    DataSourceUtils.getDataSourceFromJndi("jdbc/TEST", true);
    Connection connection = ds.getConnection();
    ArrayDescriptor arraydesc = ArrayDescriptor.createDescriptor(
    "TEST.TEST_ID_PK",
    connection);
    oracle.sql.ARRAY testIdArray = new oracle.sql.ARRAY(arraydesc,
    connection, testIdList);
    parameters.put("TEST_IDS", testIdArray);

    error message
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr:
    java.lang.ClassCastException
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    oracle.sql.ArrayDescriptor.createDescriptor(ArrayD escriptor.java:108)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    com.mycompany.business.TestDAO$UpdateQuery.doUpdat e(TestDAO.java:297)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    com.mycompany.business.TestDAO.update(IVDUserDAO.j ava:112)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    com.mycompany.web.TestController.displayMaintenanc e(TestController.java:216)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    java.lang.reflect.Method.invoke(Method.java:324)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.invokeNamedMethod(MultiActionC ontroller.java:305)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    org.springframework.web.servlet.mvc.multiaction.Mu ltiActionController.handleRequestInternal(MultiAct ionController.java:265)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:108)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:29)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:399)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    org.springframework.web.servlet.FrameworkServlet.s erviceWrapper(FrameworkServlet.java:310)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:296)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    javax.servlet.http.HttpServlet.service(HttpServlet .java:807)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    javax.servlet.http.HttpServlet.service(HttpServlet .java:908)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    org.apache.catalina.core.StandardWrapperValve.invo keServletService(StandardWrapperValve.java:771)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:322)
    [19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
    org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:509)

    Now its important I have a valid ArrayDescriptor because without it I
    am unable to save to any stored functions that use VARRAYs or table
    collections and I need this functionality back. It all worked on OAS
    but I'm trying to migrate to Sun Web Server. If these WAR files are
    truly WORE compatible it should just work without any tweaking!

    I'm hoping this is just a configuration issue and one of you Sun WS
    wizards or a J2EE wizard can help me. I've tried everything.

    Thanks

    PS I've searched everything I can get my hands on without paying
    subscriptions or support for a similar problem. This app uses the
    Spring framework but my problem is occuring before the descriptor gets
    passed to the framework for processing. Without the descriptor I can't
    create the oracle.sql.ARRAY class so I can store my java array. This
    ARRAY instance would be passed to Spring, just to complete the picture.


  2. Re: ClassCastException thrown from oracle.sql.ArrayDescriptor

    I did more investigation today. If I create an OracleDataSource
    directly and skip SUN's management of pooled connections, it works!

    So now my question if I configure the server to use
    oracle.jdbc.pool.OracleDataSource objects why is it only generating
    com.sun.enterprise.resource.JdbcDataSource objects???

    My ArrayDescriptor is expecting an OracleConnection object. A
    JdbcConnection object won't work. What do I need to configure in Sun
    ONE Webserver 6.1 SP5 to give me the correct objects. What am I doing
    wrong?


+ Reply to Thread