Как правильно собрать Jetty-env для двух Data store (UberJar)

Подскажите пожалуйста как правильно собрать jetty-env.xml для старта приложения в сборке UberJar при использовании 2х Data Store

Собрал вот так:

 <New id="CubaDS" class="org.eclipse.jetty.plus.jndi.Resource">
        <Arg/>
        <Arg>jdbc/CubaDS</Arg>
        <Arg>
            <New class="org.apache.commons.dbcp2.BasicDataSource">
                <Set name="driverClassName">org.postgresql.Driver</Set>
                <Set name="url">jdbc:postgresql://server_name/cache</Set>
                <Set name="username">cache</Set>
                <Set name="password"></Set>
                <Set name="maxIdle">50</Set>
                <Set name="maxTotal">100</Set>
                <Set name="maxWaitMillis">5000</Set>
            </New>
        </Arg>
    </New>
    <New id="TunesDS" class="org.eclipse.jetty.plus.jndi.Resource">
        <Arg/>
        <Arg>jdbc/TunesDS</Arg>
        <Arg>
            <New class="org.apache.commons.dbcp2.BasicDataSource">
                <Set name="driverClassName">org.postgresql.Driver</Set>
                <Set name="url">jdbc:postgresql://server_name/tunes</Set>
                <Set name="username">tunes</Set>
                <Set name="password"></Set>
                <Set name="maxIdle">50</Set>
                <Set name="maxTotal">100</Set>
                <Set name="maxWaitMillis">5000</Set>
            </New>
        </Arg>
    </New>

Получил ошибку:

Failed startup of context o.e.j.w.WebAppContext@6767c1fc{/cache-core,jar:file:/opt/bpm/cache/cache-core.jar!/LIB-INF/app-core,STARTING}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘entityManagerFactory_TunesDs’ defined in class path resource [com/itprofix/kvpcache/spring.xml]: Cannot resolve reference to bean ‘cubaDataSource_TunesDs’ while setting bean property ‘dataSource’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘cubaDataSource_TunesDs’ defined in class path resource [com/itprofix/kvpcache/spring.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException; remaining name ‘TunesDs’
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘cubaDataSource_TunesDs’ defined in class path resource [com/itprofix/kvpcache/spring.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException; remaining name ‘TunesDs’

Как правильно настроить второй DataStore?

Разобрались, в конфиге оказался TunesDS а в jetty-env.xml TunesDs. После исправления все заработало

1 симпатия