Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 61833 invoked from network); 2 Oct 2008 17:16:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Oct 2008 17:16:54 -0000 Received: (qmail 83686 invoked by uid 500); 2 Oct 2008 17:16:40 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 83659 invoked by uid 500); 2 Oct 2008 17:16:40 -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 83648 invoked by uid 99); 2 Oct 2008 17:16:39 -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 10:16:39 -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 74.125.78.150 as permitted sender) Received: from [74.125.78.150] (HELO ey-out-1920.google.com) (74.125.78.150) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Oct 2008 17:15:38 +0000 Received: by ey-out-1920.google.com with SMTP id 4so577952eyg.12 for ; Thu, 02 Oct 2008 10:15:53 -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=IrieczdKh6oZEoZrvDdA8IPWt+KjFRo3WSz56gV82xE=; b=sKWMfE9zevVTu2eJf/VX1OnubYlPOvH8KgNMTUf7IBuIzASi0HPEUsJu+UArpFKhPp 4+wAcLa7chG4wHRXhP/1MNbu4XKAvBFG312gCuPpK5pA6TpMNyQCMeHl6XUpH4EPfg58 pOP4y3o/ekb7W8sOyBgz10nCqkKrsm+BgWIn4= 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=A3hqJjMUEyDgzWxjGtlX2T86gkm3mo2dMKCx3VgF6iHpPxqT3UlrUPAB5aKQmr7MR1 jyGEK/DSWVslPgX1ijKWyD2SumtZQ/gV1TDMAzi/YExS4V/V4gydPa2nMDgaCj7VGgFA QKhix772FxvYo2nU5y6dGnFg1PZpjKJeOgn44= Received: by 10.210.78.16 with SMTP id a16mr11711496ebb.53.1222967753401; Thu, 02 Oct 2008 10:15:53 -0700 (PDT) Received: by 10.210.91.16 with HTTP; Thu, 2 Oct 2008 10:15:53 -0700 (PDT) Message-ID: Date: Thu, 2 Oct 2008 18:15:53 +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: <48E4FDD5.8010903@cornell.edu> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6647_12660139.1222967753402" References: <48E3BB26.6020903@cornell.edu> <48E4B6C1.3090903@cornell.edu> <48E4FDD5.8010903@cornell.edu> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_6647_12660139.1222967753402 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Yes it looks like that fact it is named with uppercase C was the problem. I renamed it to context.xml and it finally worked. Thank you all for your help. On Thu, Oct 2, 2008 at 5:59 PM, David Smith wrote: > We have a winner! > The Windows file system is one of the few (the only one I can think of) > that's not case sensitive. Unix, linux, bsd, macos, etc. , ... are all case > sensitive. You should change the file name 'Context.xml' to 'context.xml' > and check to be sure it stays that way as you build your .war file. After > that you won't need to have testapp.xml in conf/Catalina/localhost. Also > you might want to check all the places in your webapp that references a file > and be sure the names match in case to what's on disk. > > > --David > > Ziggy O wrote: > >> 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 >>> >>> >>> >>> >> >> >> > > > --------------------------------------------------------------------- > 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_6647_12660139.1222967753402--