File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and Relational Databases and the fly likes Connection pooling issue in Apache 6.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Connection pooling issue in Apache 6.0" Watch "Connection pooling issue in Apache 6.0" New topic
Author

Connection pooling issue in Apache 6.0

ujjwal soni
Ranch Hand

Joined: Mar 28, 2007
Posts: 403
This code is working fine without connection pooling but when I am using connection pooling I am facing some problem .Please check the code once I have given comment.

1) Connection pool code in apache server



2) The Error is:

java.lang.ClassCastException: oracle.jdbc.driver.OracleResultSetImpl
at com.itisl.jpmorgan.objects.FileUploadMaster.imageInsert(FileUploadMaster.java:268)
at com.itisl.jpmorgan.objects.FileUploadMaster.Insert(FileUploadMaster.java:195)
at com.itisl.jpmorgan.servlets.docupload.filename.DocUpload_Save.doPost(DocUpload_Save.java:121)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
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:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
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)




--------------------Here are the contents for server.xml and context files used in tomcat 6.0

Server.xml
In this I changed :type="javax.sql.DataSource" as
type:ā€¯oracle.jdbc.pool.OracleDataSourceā€¯




context.xml



web.xml
-auth>
</resource-ref>


Commons.java







Just for your reference I wrote:
This code is for without connection pool






Cheers!!!
Ujjwal B Soni <baroda, gujarat, india> <+919909981973>
"Helping hands are better than praying lips......"
ujjwal soni
Ranch Hand

Joined: Mar 28, 2007
Posts: 403
Hi,

I did something like this and it worked for me fine.

Servlet Code



My Web.XML content



----------And my context.xml



I Removed all new entries from server.xml that i made before
And......the ghost went away....

The code is working orsom now.........
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Connection pooling issue in Apache 6.0