이전 제목은 :JBOSS 6.0에서 webapp가 시작될 때 호넷 대기열이 있는지 어떻게 확인할 수 있습니까?
Spring을 사용하여 JBOSS 6 내의 큐에 대한 JNDI 참조를 얻으려면 어떻게해야합니까?
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="urn:hornetq"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">
<topic name="mytopic">
<entry name="mytopic"/>
</topic>
</configuration>
내 applicationContext.xml은 다음과 같습니다 :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<jee:jndi-lookup id="jmsConnectionFactory" jndi-name="java:/JmsXA" />
<jee:jndi-lookup id="jmsDestination" jndi-name="mytopic" expected-type="javax.jms.Topic" />
</beans>
이입니다
나는 파일에 MyTopic-hornetq-jms.xml에 이런 JMS 큐를 구성 JMX 콘솔을 사용하는 출력 org.jboss.naming.JNDIView :
+- UserTransactionSessionFactory (proxy: $Proxy103 implements interface org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory)
+- UUIDKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.uuid.UUIDKeyGeneratorFactory)
+- HiLoKeyGeneratorFactory (class: org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory)
+- SecureDeploymentManager (class: org.jnp.interfaces.NamingContext)
| +- remote[link -> DeploymentManager] (class: javax.naming.LinkRef)
+- SecureManagementView (class: org.jnp.interfaces.NamingContext)
| +- remote[link -> ManagementView] (class: javax.naming.LinkRef)
+- mytopic (class: org.hornetq.jms.client.HornetQTopic)
+- DeploymentManager (class: org.jboss.aop.generatedproxies.AOPProxy$4)
+- XAConnectionFactory (class: org.hornetq.jms.client.HornetQConnectionFactory)
+- ProfileService (class: org.jboss.aop.generatedproxies.AOPProxy$2)
+- SecureProfileService (class: org.jnp.interfaces.NamingContext)
| +- remote[link -> ProfileService] (class: javax.naming.LinkRef)
+- queue (class: org.jnp.interfaces.NamingContext)
| +- DLQ (class: org.hornetq.jms.client.HornetQQueue)
| +- ExpiryQueue (class: org.hornetq.jms.client.HornetQQueue)
+- UserTransaction (class: org.jboss.tm.usertx.client.ClientUserTransaction)
+- ConnectionFactory (class: org.hornetq.jms.client.HornetQConnectionFactory)
+- jmx (class: org.jnp.interfaces.NamingContext)
| +- invoker (class: org.jnp.interfaces.NamingContext)
| | +- RMIAdaptor (class: javax.management.MBeanServerConnection)
| +- rmi (class: org.jnp.interfaces.NamingContext)
| | +- RMIAdaptor (class: javax.management.MBeanServerConnection)
+- BeanValidatorFactories (class: org.jnp.interfaces.NamingContext)
+- TomcatAuthenticators (class: java.util.Properties)
+- XAThroughputConnectionFactory (class: org.hornetq.jms.client.HornetQConnectionFactory)
+- ManagementView (class: org.jboss.aop.generatedproxies.AOPProxy$3)
+- ThroughputConnectionFactory (class: org.hornetq.jms.client.HornetQConnectionFactory)
내 책이 화제가 그럼에도 불구하고
봄이18:45:29,636 ERROR [ContextLoader] Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsDestination': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: mytopic not bound
...
Caused by: javax.naming.NameNotFoundException: mytopic not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771) [:5.0.5.Final]
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779) [:5.0.5.Final]
at org.jnp.server.NamingServer.getObject(NamingServer.java:785) [:5.0.5.Final]
at org.jnp.server.NamingServer.lookup(NamingServer.java:443) [:5.0.5.Final]
UPDATE를 던져 않습니다 "에 MyTopic"JNDI 이름에 바인딩 의미
실제로까지보고 문제가 아니라고 보인다 JNDI 참조이지만 실제로 응용 프로그램이 시작될 때 호 넷 대기열이 구성되어 있지 않습니다.
나중에 응용 프로그램을 배포하면이 시간에 호른 대기열 이으로 설정되어 있기 때문에 나중에 응용 프로그램을 배포해도 문제가 없습니다.
대기열이 될 때까지 응용 프로그램이 시작되지 않거나 나머지가 시작될 때까지 jboss가 배치를 유지하는 구성 옵션을 지정하는 방법이 있습니까?
예, 정상적으로 작동합니다. – Mauli