I'm using <j2ee:jndi-lookup> to get my DataSource. I'd like the JNDI environment to be configurable, so I'm using a PlaceHolder and a properties file to set java.naming.factory.initial.
So I've set :
But I also want this property to be optional, so that I can get the default JNDI context.
<j2ee:jndi-lookup id="dataSource" jndi-name="jdbc/BGCAF">
If I don't set the property, the placeholder fails (Could not resolve placeholder...).
If I set the property to "" (empty), I get a NoInitialContextException as InitialContext tries to instantiate "" class.
Is there any way to make some part of the Spring context optional ?