Tomcat vs Weblogic JNDI Lookup [英] Tomcat vs Weblogic JNDI Lookup
问题描述
我们使用的Weblogic服务器已配置为允许JNDI数据源名称,如appds。
The Weblogic servers we are using have been configured to allow JNDI datasource names like "appds".
对于开发(localhost),我们可能正在运行Tomcat,在< context>中声明在server.xml的一节中,Tomcat会在JNDI树中的java:comp / env / jdbc / *上挂起JNDI数据源。
For development (localhost), we might be running Tomcat and when declared in the <context> section of server.xml, Tomcat will hang JNDI datasources on "java:comp/env/jdbc/*" in the JNDI tree.
问题:在Weblogic中,JNDI查找是appds,而在Tomcat中,似乎我必须提供正式的java:comp / env / jdbc / appds。我担心Tomcat版本是一个隐含的标准,但不幸的是,我无法更改Weblogic的配置...所以这意味着我们最终会得到两个不同的spring配置文件(我们使用的是spring 2.5)来促进不同的环境。
Problem: in Weblogic, the JNDI lookup is "appds" whilst in Tomcat, it seems that that I must provide the formal "java:comp/env/jdbc/appds". I'm afraid the Tomcat version is an implicit standard but unfortunately, I can't change Weblogic's config ... so that means we end up with two different spring config files (we're using spring 2.5) to facilitate the different environments.
有没有一种优雅的方式来解决这个问题。我可以直接在Tomcat中查看JNDI名称吗?春天可以在这两个地方取名吗? Google搜索或建议会很棒。
Is there an elegant way to address this. Can I look JNDI names up directly in Tomcat? Can Spring take a name and look in both places? Google searches or suggestions would be great.
推荐答案
JndiLocatorSupport
有一个属性了resourceRef
。设置为true时,java:comp / env /前缀将自动添加前缀。因此,我认为从Tomcat迁移到Weblogic时区分此参数是正确的。
JndiLocatorSupport
has a property resourceRef
. When setting this true, "java:comp/env/" prefix will be prepended automatically. So I believe it would be correct to differentiate this parameter when moving from Tomcat to Weblogic.
这篇关于Tomcat vs Weblogic JNDI Lookup的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!