Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.ClassCastException: oracle.sql.CLOB

 
Firas Najjar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am getting this error when I try to use oracle.sql.CLOB
Any help would be greatly appreciated

Here is my code (Inside DB.java)




And here is the error I am getting from catalina.out

java.lang.ClassCastException: oracle.sql.CLOB
at mdx.DB.updateClob(DB.java:116)
at org.apache.jsp.processEditBidItem_jsp._jspService(org.apache.jsp.processEditBidItem_jsp:174)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:319)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

Thanks in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64608
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the JDBC forum.
 
Firas Najjar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
stu derby, Thanks for your reply.
This code is working on a resin environment; I moved to Tomcat5.5.12 and now
it is not working; it compiles correctly but when I try to use it gives this error.
I am not a JSP/JAVA expert and I did not write this code I just want it to work.
I am sure that the code in the link you send to is great but it will take a lot of time to figure it out.
I use this code when I want to insert or update to the Clob field.

Any help would greatly appreciated.
Thank you
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the problem is likely that you don't have the OracleResultSet. Most appservers have proxy classes for the JDBC driver. They don't have a choice in the matter if they want to manage a connection pool. If I'm correct, than that would mean the result set isn't returning an Oracle CLOB, it is returning a Resin wrapper around the Oracle CLOB. Whenever I've hit this problem before its always been because of a proxy class.
[ January 12, 2006: Message edited by: Reid M. Pinchback ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic