java:comp/env/是做什么的? [英] What does java:comp/env/ do?
本文介绍了java:comp/env/是做什么的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在连接一些JNDI工厂bean时,我花了太多时间试图找出一些错误.问题原来是,而不是这个...
I just spent too much time of my day trying to figure out some errors when hooking up some JNDI factory bean. The problem turned out to be that instead of this...
<bean id="someId" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/loc"/>
</bean>
我实际上是写这个的...
I had actually written this...
<bean id="someId" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/loc"/>
</bean>
我推断java:comp/env/可能引用了一些环境变量并使之生效,以便最终查看我的上下文文件.唯一的区别是java:comp/env/.从专家的口中,这是做什么的?
I infer that the java:comp/env/ perhaps references some environment variable and makes it so that, ultimately, my context file is looked at. The only difference is java:comp/env/. From an expert's mouth, what does that do?
在值中没有java:comp/env前缀的情况下,我会收到一条错误消息,提示名称jdbc在此上下文中未绑定".
Without the java:comp/env prefix in the value, I would get an error that said "Name jdbc is not bound in this Context".
推荐答案
查看全文