-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dale,

On 12/13/2010 3:08 PM, Dale Ogilvie wrote:
> We are using a spring jndi-lookup to pull the name of a context file
> from the global "environment" in our apps. We have set this up in tomcat
> 6.0.29 like so:
> 
> $CATALINA_HOME/conf/context.xml

Technically speaking, I think that's the default local environment, not
the global environment. You can define <Environment> entries at the
<Server> level in server.xml which would be truly "global". It's all
semantics for this discussion and shouldn't impact this case.

> <Environment name="/propertiesFileName"
> value="classpath:test-application.properties" type="java.lang.String"
> override="true"/>
> 
> This has worked fine for lots of applications, but last week it started
> failing for one application when it was redeployed. This results in the
> application failing to start.
> 
> The error message below suggests that the environment value cannot be
> found.
> 
> Tomcat 6.0.29 log output:
>  
> 2010-12-08 19:27:24,674 DEBUG ** Invoking afterPropertiesSet() on bean
> with name 'propsFileName' **

'propsFileName' != 'propertiesFileName'

Are you sure you're looking at the right configuration file?

> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'propsFileName': Invocation of init method failed; nested
> exception is javax.naming.NameNotFoundException: Name propertiesFileName
> is not bound in this Context

Perhaps propsFileName is bound, but not propertiesFileName.

> Spring application web.xml
> 
>     <context-param>
>         <param-name>contextConfigLocation</param-name>
>         <param-value>
>             classpath:applicationContext-shared.xml
>         </param-value>
>     </context-param>
> 
>     <listener>
>  
> <listener-class>org.springframework.web.context.ContextLoaderListener</l
> istener-class>
>     </listener>
> 
> applicationContext-Shared.xml
> 
>     <jee:jndi-lookup id="propsFileName" jndi-name="propertiesFileName"
> />
> 
>     <bean
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfi
> gurer">
>        <property name="location" ref="propsFileName"/>
>     </bean>

I don't see where the data is ultimately defined... I just see a bunch
of references that don't point to anything. propertiesFileName ->
propsFileName -> ???

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0GhfkACgkQ9CaO5/Lv0PB5OQCfa20jn6k8gt/jvp211sFgA+KZ
YRsAn3FFKu9rx2BidCKz64FKo+Vnb7LO
=HtIz
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to