在Weblogic 10上向JNDI添加自定义对象 [英] Adding custom object to JNDI on Weblogic 10
问题描述
是否可以使用Weblogic服务器管理控制台(Weblogic 10.0)或通过编辑服务器的配置文件(config.xml)将自定义对象(字符串或URL)添加到JNDI?
Is it possible to add a custom object (String or URL) to JNDI using Weblogic Server Administration Console (Weblogic 10.0) or by editing server's configuration file (config.xml)?
推荐答案
我不这么认为.引用在JNDI树中加载对象:
使用管理控制台,可以在JNDI树中加载WebLogic Server J2EE服务和组件,例如RMI,JMS,EJB和JDBC数据源.
Using the Administration Console, you can load WebLogic Server J2EE services and components, such as RMI, JMS, EJBs, and JDBC Data Sources, in the JNDI tree.
确实,我找不到使用控制台添加String
或URL
的方法.
And indeed, I couldn't find a way to add a String
or URL
using the console.
AFAIK,标准方法是在部署描述符(web.xml,ejb-jar.xml)中放入env-entry
:
AFAIK, the standard way is to put an env-entry
in your deployment descriptor (web.xml, ejb-jar.xml):
<env-entry>
<env-entry-name>string/foo</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>foobar</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>url/bar</env-entry-name>
<env-entry-type>java.net.URL</env-entry-type>
<env-entry-value>http://foobar/</env-entry-value>
</env-entry>
这篇关于在Weblogic 10上向JNDI添加自定义对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!