In Tomcat any jndi resources defined in context.xml have prefix java:/comp/env/
. In Websphere they don't. There're quite a few resources that we are injecting with
@Resource(mappedName="...")
private Queue queue1;
and it's a pain to configure them twice for local and managed environments. I would like to configure it to have only only @Resource injection that will work for all environments. That's the point of using jndi after all.
There are ways to configure Tomcat to define a global jndi resource but they all involve changing server.xml, which we can't do since it's a gradle tomcat plugin.
Is there any way to achieve the same effect without modifying server.xml in Tomcat?
java:comp/env/
, notjava:/comp/env/
as used by some application servers. – Brett Kail