That has nothing to do with Tomcat, just autowire them by name and not by type like the exception is telling you.
Kevin Huntly <kmhun...@gmail.com> schrieb am Fr., 14. Apr. 2023, 13:47: > Hi Everyone, > > I can't remember if I posted this already or not (and I don't know how to > check)... I'm getting the following message when I have more than one > <Environment> value to obtain: > > tomcat config in context.xml > <Environment name="environment" value="dev" type="java.lang.String" > override="false" /> > <Environment name="isTestSystem" value="true" type="java.lang.String" > override="false" /> > <Environment name="webURL" value="myodmain.com" type="java.lang.String" > override="false" /> > > And my Spring config: > > <jee:jndi-lookup expected-type="java.lang.String" id="isTestSystem" > jndi-name="java:comp/env/isTestSystem" /> > > <jee:jndi-lookup expected-type="java.lang.String" id="webURL" jndi-name= > "java:comp/env/webURL" /> > > <jee:jndi-lookup expected-type="java.lang.String" id="isResetAvailable" > jndi-name="java:comp/env/isResetAvailable" /> > > > I'm getting the following exception: > > > Caused by: > org.springframework.beans.factory.UnsatisfiedDependencyException: Error > creating bean with name 'appConfig': Unsatisfied dependency expressed > through field 'homePage'; nested exception is > org.springframework.beans.factory.NoUniqueBeanDefinitionException: No > qualifying bean of type 'java.lang.String' available: expected single > matching bean but found 2: isTestSystem,webURL Anyone have any ideas? > ________________________________________________ > > Kevin Huntly > Email: kmhun...@gmail.com > Cell: 716/424-3311 > ________________________________________________ > > -----BEGIN GEEK CODE BLOCK----- > Version: 1.0 > GCS/IT d+ s a C++ UL+++$ P+(++) L+++ E--- > W+++ N+ o K(+) w--- O- M-- V-- PS+ PE Y(+) > PGP++(+++) t+ 5-- X-- R+ tv+ b++ DI++ D++ > G++ e(+) h--- r+++ y+++* > ------END GEEK CODE BLOCK------