Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 49721 invoked from network); 2 Oct 2008 12:49:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Oct 2008 12:49:30 -0000 Received: (qmail 27061 invoked by uid 500); 2 Oct 2008 12:49:17 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 27029 invoked by uid 500); 2 Oct 2008 12:49:16 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 27018 invoked by uid 99); 2 Oct 2008 12:49:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Oct 2008 05:49:16 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dini25@gmail.com designates 64.233.182.187 as permitted sender) Received: from [64.233.182.187] (HELO nf-out-0910.google.com) (64.233.182.187) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Oct 2008 12:48:15 +0000 Received: by nf-out-0910.google.com with SMTP id c10so407971nfd.44 for ; Thu, 02 Oct 2008 05:48:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :to:subject:in-reply-to:mime-version:content-type:references; bh=gol9CruFzgYCv3uCs54hWZezKnnrFHD69V/6at7VO5g=; b=t1keOG+iiduEAaPKshAPnIZsCLiqSIAeXWjyRpGEbv31YVF5wOolWfkalBBa0IlGYW YiJz5/A+v3jPHEQME4e2ReiMZp/ki5yg7mawkzb7AVdptI8u1iuktgqSSYP+pixqhjR1 qXxhuDQv3BPXl5UwHkyCGJll8FYN2/0w0r4ss= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:in-reply-to:mime-version :content-type:references; b=EZ7rhHPbjhlslXzw2Lb2tg5VT77M6X/UkSgyn0bCnd0cxubVc0VE7twdPk6mlAOMUH xWeypYbCr50lKmkfe5WdmnjTgiqgrLJ5bcpabNBtnwCz508+y/6IVf+FnSB59SMXZl2b cuz+Br9pksYLDQb9I/y73WK8bOFFpbpi2VyK4= Received: by 10.210.46.4 with SMTP id t4mr11349631ebt.152.1222951711351; Thu, 02 Oct 2008 05:48:31 -0700 (PDT) Received: by 10.210.91.16 with HTTP; Thu, 2 Oct 2008 05:48:31 -0700 (PDT) Message-ID: Date: Thu, 2 Oct 2008 13:48:31 +0100 From: "Ziggy O" Reply-To: Dini@Dinionline.com To: "Tomcat Users List" Subject: Re: javax.naming.NamingException: Cannot create resource instance In-Reply-To: <48E4B6C1.3090903@cornell.edu> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2558_4384040.1222951711348" References: <48E3BB26.6020903@cornell.edu> <48E4B6C1.3090903@cornell.edu> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_2558_4384040.1222951711348 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, The tomcat version on my Desktop is 5.5.27 and the Tomcat version on the Unix environment is 5.5.23. Could the above minor version difference cause it? One thing i have noticed is that if i take the /META-INF/Context.xml file and copy it into $CATALINA_HOME/conf/Catalina/localhost/testapp.xml it does work. i.e. why does it require the context file in that directory and why does it have to be renamed to my applications context. On the Windows environment i dont have to rename and copy the context file to $CATALINA_HOME/conf/Catalina/localhost Thanks On Thu, Oct 2, 2008 at 12:55 PM, David Smith wrote: > Ok... > > 1) I don't see a tomcat version, could you post that? > 2) Are you sure the tomcat version on the production environment the same > as your dev system? > 3) This is probably not causing the immediate problem, but ... > in your web.xml should be javax.sql.Datasource, not > oracle.jdbc.pool.OracleDataSource. > > --David > > > Ziggy O wrote: > >> No mate that was the full stack trace. >> >> Thanks >> >> >> On Wed, Oct 1, 2008 at 7:02 PM, David Smith wrote: >> >> >> >>> Seems like such a generic error would have a root cause. Was there >>> anything more to the stack trace? >>> >>> --David >>> >>> >>> Ziggy O wrote: >>> >>> >>> >>>> Hi, >>>> >>>> I am trying to connect to an oracle database but cant seem to get the >>>> jdbc >>>> connection to work. I am developing the application on a Windows desktop >>>> and >>>> transferring it onto a Unix box. >>>> >>>> When i test it on the Windows environmnet it does manage to connect but >>>> if >>>> i >>>> test it on unix then i get an error. My gut feeling is that the >>>> installation >>>> on the unix environment is missing a library but i cant figure out what >>>> it >>>> is. >>>> >>>> Here is how i am trying to get the jndi connection. >>>> >>>> [code] >>>> String fullname; >>>> if (jndiPrefix != null && jndiPrefix.length() > 0) >>>> fullname = jndiPrefix + datasource; >>>> else >>>> fullname = datasource; >>>> >>>> // JNDI >>>> Context ctx = null; >>>> DataSource ds = null; >>>> Connection conn = null; >>>> >>>> try >>>> { >>>> ctx = new InitialContext(); >>>> Context envContext = (Context)ctx.lookup("java:/comp/env"); >>>> if (ctx != null) >>>> { >>>> ds = (DataSource)envContext.lookup(fullname); >>>> if (ds != null) >>>> { >>>> conn = ds.getConnection(); >>>> } >>>> } >>>> } >>>> [/code] >>>> >>>> And here is the Configuration. >>>> >>>> Context.xml (User and password modified) >>>> >>>> [code] >>>> >>> type="javax.sql.DataSource" >>>> driverClassName="oracle.jdbc.driver.OracleDriver" >>>> url="jdbc:oracle:thin:@localhost:1521:webdev" >>>> username="webuser" password="webuser" maxActive="20" >>>> maxIdle="10" >>>> maxWait="-1"/> >>>> [/code] >>>> >>>> web.xml >>>> >>>> [code] >>>> >>>> Oracle Datasource >>>> jdbc/theDb >>>> oracle.jdbc.pool.OracleDataSource >>>> Container >>>> >>>> >>>> [/code] >>>> >>>> And here is the stack trace of the error >>>> >>>> [code] >>>> javax.naming.NamingException: Cannot create resource instance >>>> at >>>> >>>> >>>> org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:143) >>>> at javax.naming.spi.NamingManager.getObjectInstance(Unknown >>>> Source) >>>> at org.apache.naming.NamingContext.lookup(NamingContext.java:793) >>>> at org.apache.naming.NamingContext.lookup(NamingContext.java:140) >>>> at org.apache.naming.NamingContext.lookup(NamingContext.java:781) >>>> at org.apache.naming.NamingContext.lookup(NamingContext.java:153) >>>> at >>>> com.bt.ccs21.util.DbConnection.getJNDIConnection(DbConnection.java:334) >>>> at >>>> com.bt.ccs21.util.DbConnection.getJNDIConnection(DbConnection.java:256) >>>> at >>>> com.bt.ccs21.util.DbConnection.getJRunConnection(DbConnection.java:286) >>>> at >>>> >>>> >>>> com.bt.ccs21.presentation.events.admin.LogonActionPost.preAction(LogonActionPost.java:118) >>>> at >>>> >>>> >>>> com.bt.ccs21.presentation.events.CCS21EventAction.execute(CCS21EventAction.java:29) >>>> at >>>> >>>> >>>> org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58) >>>> at >>>> >>>> >>>> org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67) >>>> at >>>> >>>> >>>> org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) >>>> at >>>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) >>>> at >>>> >>>> >>>> org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304) >>>> at >>>> org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) >>>> at >>>> >>>> >>>> org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) >>>> at >>>> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) >>>> at >>>> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) >>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) >>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) >>>> at >>>> >>>> >>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) >>>> at >>>> >>>> >>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) >>>> at >>>> >>>> >>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) >>>> at >>>> >>>> >>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) >>>> at >>>> >>>> >>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) >>>> at >>>> >>>> >>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) >>>> at >>>> >>>> >>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) >>>> at >>>> >>>> >>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) >>>> at >>>> >>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) >>>> at >>>> >>>> >>>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) >>>> at >>>> >>>> >>>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) >>>> at >>>> >>>> >>>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) >>>> at >>>> >>>> >>>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) >>>> at java.lang.Thread.run(Unknown Source) >>>> "/tmp/crmsauth.log.20081001" 561 lines, 48080 characters >>>> at >>>> >>>> >>>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) >>>> at >>>> >>>> >>>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) >>>> at >>>> >>>> >>>> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) >>>> at >>>> >>>> >>>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) >>>> at java.lang.Thread.run(Unknown Source) >>>> [/code] >>>> >>>> What i dont understand is why it works on the installation on the >>>> windows >>>> environment but not in the Unix environment. I check all the libraries >>>> and >>>> everything under common/lib is the same for both environments. >>>> >>>> Thanks >>>> >>>> Edited by: ziggy on Oct 1, 2008 3:48 PM >>>> >>>> Edited by: ziggy on Oct 1, 2008 3:50 PM >>>> >>>> >>>> >>>> >>>> >>> --------------------------------------------------------------------- >>> To start a new topic, e-mail: users@tomcat.apache.org >>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >>> For additional commands, e-mail: users-help@tomcat.apache.org >>> >>> >>> >>> >> >> >> > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > ------=_Part_2558_4384040.1222951711348--