Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

ClassCastException thrown from oracle.sql.ArrayDescriptor

Thread view: 
BBedard - 19 Apr 2006 23:41 GMT
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.
BBedard - 20 Apr 2006 23:47 GMT
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?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.