tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Somu Sundar Reddy.Y" <ys...@yahoo.com>
Subject Need some help in using Oracle Database connection pool in jakarta-tomcat-5.0.28
Date Tue, 05 Jun 2007 18:26:47 GMT
  
Hi,
 
  
  Need some help in using Oracle Database connection pool in jakarta-tomcat-5.0.28
   
  Problem Description: 
   
   I created a JNDI(Name is jdbc/TestOracle ) for Oracle using Tomcat Admin console Example
--TomcatServer->Service->Host->Context(TestProject)->Resources->DataSources
using oracle.jdbc.driver.OracleDriver driver
  In my web application I created a connection using above JNDI name.
   
    private static final String JNDI_POOL="jdbc/TestOracle ";
  Context oracleObjCtx = new InitialContext();
  DataSource ds=null; 
  try { 
  ds = (DataSource) oracleObjCtx.lookup(JNDI_POOL);
  
  } catch (Exception ne) {
  oracleObjCtx = (Context)oracleObjCtx.lookup("java:comp/env");
  ds = (DataSource) oracleObjCtx.lookup(JNDI_POOL);
   } 
  conn = (Connection)ds.getConnection();
   
  Above  code is working fine in Window environment and it 's  throwing  exception in Linux
while creating a DataSource
  Error Message is 
  Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:768)
 at org.apache.naming.NamingContext.lookup(NamingContext.java:151)
 at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
 at javax.naming.InitialContext.lookup(InitialContext.java:351)
 at com.usscript.util.ConnectionManager.getOracleConnectionFromPool(ConnectionManager.java:26)
 at com.usscript.dataaccess.AuthenticatorDAO.getUserDetailsAfterFirstTimeAccess(AuthenticatorDAO.java:132)
 at com.usscript.dataaccess.AuthenticatorDAO.getUserDetails(AuthenticatorDAO.java:29)
 at com.usscript.delegate.LoginDelegateHandler.getUserDetails(LoginDelegateHandler.java:125)
 at com.usscript.action.LoginAction.execute(LoginAction.java:39)
 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
 at com.usscript.util.USScriptActionServlet.doPost(USScriptActionServlet.java:48)
 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:237)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
 at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
 at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
 at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
 at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
 at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
 at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
 at java.lang.Thread.run(Thread.java:595)
   
  Thank,
  Somu
  573-462-0599
   
   
   
   
    



       
---------------------------------
Be a better Globetrotter. Get better travel answers from someone who knows.
Yahoo! Answers - Check it out.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message