JNDI 上下文 :: 名称 jms 未在此上下文中绑定
我正在尝试将 JMS 服务器(OpenJMS)配置到 Spring 应用程序中,当我使用符号“jms/<>”引用资源时,我得到一个“名称”未绑定异常。
有什么线索缺少什么吗?
javax.naming.NameNotFoundException: Name jms is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:768)
at org.apache.naming.NamingContext.lookup(NamingContext.java:138)
at org.apache.naming.NamingContext.lookup(NamingContext.java:779)
at org.apache.naming.NamingContext.lookup(NamingContext.java:138)
该 bean 是定义为:
<bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate" ref="jmsProvider"/>
<property name="jndiName" value="jms/RefreshTopic_CF"/>
<property name="resourceRef" value="true" />
</bean>
我在类路径中有 JMS 库,并且 openjms 服务器正在运行。
I am trying to configure a JMS server (OpenJMS) into a Spring application and when I refer the resources using the notation "jms/<> I get a "name" not bound exception.
Any clue what is missing?
javax.naming.NameNotFoundException: Name jms is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:768)
at org.apache.naming.NamingContext.lookup(NamingContext.java:138)
at org.apache.naming.NamingContext.lookup(NamingContext.java:779)
at org.apache.naming.NamingContext.lookup(NamingContext.java:138)
The bean is defined as:
<bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate" ref="jmsProvider"/>
<property name="jndiName" value="jms/RefreshTopic_CF"/>
<property name="resourceRef" value="true" />
</bean>
I have the JMS lib in class path and the openjms server is running.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在 web.xml 中,我们无法将其引用为接口 (javax.jms.Topic),我们必须使用确切的类。这是 OpenJMS 的问题,而不是 Websphere 的问题。
不允许:
允许:
In the web.xml we couldn't refer the as an interface (javax.jms.Topic) we had to use the exact class. This was a problem with OpenJMS and not with Websphere.
Not allowed:
allowed:
看来您没有
It seems you either
就我而言,我必须将资源(即 jms/XXX)从 tomcat 的 server.xml 移动到 context.xml,然后重新启动 tomcat 就可以了。
In my case I had to move the resource i.e jms/XXX from server.xml of tomcat to context.xml and then restarting the tomcat did the trick.