ClassCastException thrown from oracle.sql.ArrayDescriptor

B

BBedard

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(ArrayDescriptor.java:108)
[19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
com.mycompany.business.TestDAO$UpdateQuery.doUpdate(TestDAO.java:297)
[19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
com.mycompany.business.TestDAO.update(IVDUserDAO.java:112)
[19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
com.mycompany.web.TestController.displayMaintenance(TestController.java:216)
[19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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.MultiActionController.invokeNamedMethod(MultiActionController.java:305)
[19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:265)
[19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:108)
[19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.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.serviceWrapper(FrameworkServlet.java:310)
[19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
org.springframework.web.servlet.FrameworkServlet.doPost(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.invokeServletService(StandardWrapperValve.java:771)
[19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
[19/Apr/2006:17:05:14] warning ( 2512): CORE3283: stderr: at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.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.
 
B

BBedard

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top