title: How to access Resource Environment Entry from Spring?
body: <p>Can you use SPEL in spring to access a Resource Environment Entries custom properties? Or would you use  configured with a jndi look-up to the resource provider referenceable?</p>
  
  <p><strong>Container Details</strong> Websphere</p>
  
  <p><strong>Resource Environment Provider:</strong> provider</p>
  
  <p><strong>Referenceables:</strong> com.ibm.acme.ree.lib.ConfigNoCache</p>
  
  <p><strong>Resource environment JNDI Name:</strong> rep/provider/TestEntry/ResourceReference</p>
  
  <p><strong>Custom Property:</strong> mqPort</p>
  
  <p><strong>Example</strong>
  <strong>Configuration Within ibm-ejb-jar-bnd.xml</strong></p>
  
  <pre><code>    &lt;session name="testBean"&gt;
      &lt;resource-env-ref name="config"
          binding-name="rep/provider/TestEntry/ResourceReference" /&gt;
  &lt;/session&gt;
  </code></pre>
  
  <p>Trying something like this to load the resource environment reference so I use a place holder in spring.</p>
  
  <pre><code>&lt;bean id="envConfig" class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"&gt;
     &lt;!-- add JNDI based properties exposed by the container --&gt;
     &lt;property name="properties"&gt;
          &lt;bean class="java.util.Properties"&gt;
              &lt;constructor-arg&gt;
                  &lt;map&gt;
                      &lt;entry key="mqPort"&gt;
                          &lt;jee:jndi-lookup jndi-name="java:rep/provider/TestEntry/ResourceReference"/&gt;
                      &lt;/entry&gt;
                  &lt;/map&gt;
              &lt;/constructor-arg&gt;
          &lt;/bean&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p><strong>Reference Article doing it the old way:</strong>
  <a href="https://blogs.perficient.com/ibm/2012/05/01/using-wps-style-resource-environment-providers-with-spring/" rel="nofollow">https://blogs.perficient.com/ibm/2012/05/01/using-wps-style-resource-environment-providers-with-spring/</a></p>