Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 87809 invoked from network); 18 Apr 2010 13:46:38 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Apr 2010 13:46:38 -0000 Received: (qmail 36418 invoked by uid 500); 18 Apr 2010 13:46:34 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 36380 invoked by uid 500); 18 Apr 2010 13:46:34 -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 36371 invoked by uid 99); 18 Apr 2010 13:46:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Apr 2010 13:46:34 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=FORGED_HOTMAIL_RCVD2,FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Apr 2010 13:46:29 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1O3Up6-0005eV-Jz for users@tomcat.apache.org; Sun, 18 Apr 2010 06:46:08 -0700 Message-ID: <28282342.post@talk.nabble.com> Date: Sun, 18 Apr 2010 06:46:08 -0700 (PDT) From: alvins To: users@tomcat.apache.org Subject: Re: [Tomcat 7-RC1] JNDI Startup Issue In-Reply-To: <4BCAFCF8.6010300@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: alvins1982@hotmail.com References: <28279732.post@talk.nabble.com> <4BCAFCF8.6010300@apache.org> markt-2 wrote: > > Define "during startup". What exactly are you doing? > - I have a war-file sitting on FS - I have a context file - server/conf/Catalina/ROOT.xml. In this I have defined a dataSource. Context file references the war file. - In the war file there is a spring xml file with the following (excerpt) - - In the war file there is web.xml with the following (excerpt) - contextConfigLocation classpath:applicationContext.xml org.springframework.web.context.ContextLoaderListener - Tomcat is not running. I startup tomcat via /usr/local/tomcat7/bin/startup.sh Tomcat 'during startup' (i.e. before the following log message 'INFO: Server startup in XXXX ms') will initialise Spring - Spring will then try and lookup the dataSource in JNDI but fails. Works fine in Tomcat 6.x. As I mentioned it's not specifically to do with Spring - same error occurs with non-Spring lookup. Stack-trace below. Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name comp is not bound in this Context at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE] ... 49 common frames omitted Caused by: javax.naming.NameNotFoundException: Name comp is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:774) [catalina.jar:7.0.0-RC1] at org.apache.naming.NamingContext.lookup(NamingContext.java:157) [catalina.jar:7.0.0-RC1] at org.apache.naming.SelectorContext.lookup(SelectorContext.java:156) [catalina.jar:7.0.0-RC1] at javax.naming.InitialContext.lookup(InitialContext.java:392) [na:1.6.0_17] at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187) [spring-context-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1469) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409) [spring-beans-3.0.2.RELEASE.jar:3.0.2.RELEASE] ... 56 common frames omitted -- View this message in context: http://old.nabble.com/-Tomcat-7-RC1--JNDI-Startup-Issue-tp28279732p28282342.html Sent from the Tomcat - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org