[英]javax.naming.NameNotFoundException: java:jboss/jms/exampleApp/SampleQueueIn
We are migrating from JBoss EAP 6.4 to JBoss EAP 7.0.我们正在从 JBoss EAP 6.4 迁移到 JBoss EAP 7.0。 Our earlier JMS configuration is not working with JBoss 7.0 where it is throwing NameNotFoundException for my JMS beans
我们早期的 JMS 配置不适用于 JBoss 7.0,它会为我的 JMS bean 抛出 NameNotFoundException
my jms.xml我的jms.xml
<beans profile="jboss">
<bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:jboss/jms/exampleApp/ConnectionFactory" />
<property name="resourceRef" value="true" />
</bean>
<bean id="SampleQueueIn" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:jboss/jms/exampleApp/SampleQueueIn" />
<property name="resourceRef" value="true" />
</bean>
</beans>
My messageListener.xml我的messageListener.xml
<beans profile="jboss">
<!-- Abstract MessageListener -->
<bean id="messageListener" abstract="true" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="connectionFactory" />
<property name="transactionManager" ref="transactionManager" />
<property name="sessionTransacted" value="true" />
<!-- Receive timeout determines the duration of JMS session. Increase from default 1sec to 5sec, to lower the traffic to Queue managers -->
<property name="receiveTimeout" value="5000" />
</bean>
</beans>
my proxy-domain componentContext.xml which has listener beans我的代理域 componentContext.xml 具有侦听器 bean
<beans profile="jboss">
<bean id="jmsContainer" parent="messageListener">
<property name="destination" ref="SampleQueueIn" />
<property name="messageListener" ref="sampleInformationListenerImpl" />
</bean>
</beans>
commands.cli part for adding admin objects for wmq用于为 wmq 添加管理对象的 commands.cli 部分
/subsystem=resource-adapters/resource-adapter=${wmq_deploy_name}:activate
/subsystem=resource-adapters/resource-adapter=${wmq_deploy_name}/admin-objects=SampleQueueIn:add(class-name=com.ibm.mq.connector.outbound.MQQueueProxy,jndi-name=java:jboss/jms/exampleApp/SampleQueueIn)
/subsystem=resource-adapters/resource-adapter=${wmq_deploy_name}/admin-objects=SampleQueueIn/config-properties=baseQueueName/:add(value=${filter_jms_queue_config_SampleQueueIn_basequeuename})
/subsystem=resource-adapters/resource-adapter=${wmq_deploy_name}/admin-objects=SampleQueueIn/config-properties=baseQueueManagerName/:add(value=${filter_jms_queue_config_basequeuemanager})
I can see my admin objects in the JBoss for wmq under sub resources with correct jndi-name also.我可以在子资源下的 wmq JBoss 中看到我的管理对象,也具有正确的 jndi 名称。
I am using IBM wmq v9.1.0.2.我正在使用 IBM wmq v9.1.0.2。
[EDIT] Once I deploy my WAR file, I am getting the below exception [编辑] 部署我的 WAR 文件后,出现以下异常
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SampleQueueIn' defined in class path resource [jms.xml]: Invocation of init method failed;
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'SampleQueueIn' defined in class path resource [jms.xml]: Invocation of init 方法失败; nested exception is javax.naming.NameNotFoundException: jms/exampleApp/SampleQueueIn-- service jboss.naming.context.java.jboss.jms.exampleApp.SampleQueueIn
嵌套异常是 javax.naming.NameNotFoundException: jms/exampleApp/SampleQueueIn-- service jboss.naming.context.java.jboss.jms.exampleApp.SampleQueueIn
This configuration was working(still working) in jboss eap 6.4.此配置在 jboss eap 6.4 中工作(仍在工作)。
I have scourged jboss developer sites & stackoverflow sites but no avail till now!我搜索了 jboss 开发者网站和 stackoverflow 网站,但直到现在都无济于事!
I can see that my我可以看到我的
I resolved the error with reload of JBoss server after running the CLI commands.我在运行 CLI 命令后通过重新加载 JBoss 服务器解决了错误。 I automated the execution of both jboss cli commands & reload commands to make sure that the JNDI objects lookup is successful.
我自动执行了 jboss cli 命令和重新加载命令,以确保 JNDI 对象查找成功。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.