2010-11-24 2 views
2

이전 제목은 :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가 배치를 유지하는 구성 옵션을 지정하는 방법이 있습니까?

답변

2

저는 Jboss 4.2에서 "depends"메커니즘을 성공적으로 사용했습니다. 그것으로 무언가가 다른 것에 의존한다는 것을 지정할 수 있습니다 (xml 디스크립터를 사용하거나 ejb3 용으로 주석을 사용할 수 있습니다). 여기에 당신을 얻을 수있는 링크가 있습니다 started

+0

예, 정상적으로 작동합니다. – Mauli

0

java:/ 접두어를 추가하면 어떻게됩니까? (JmsXA와 동일)? 즉

<jee:jndi-lookup id="jmsDestination" jndi-name="java:/mytopic" expected-type="javax.jms.Topic" /> 

현재로서는 JNDI 덤프에 JmsXA 이름 아래에 정의 된 내용이 없습니다. 당신도 그 문제가있을 수 있습니다.

+0

나는 이미 다른 조합을 시도했습니다. JNDI 덤프는 전역 이름 공간의 덤프 일뿐입니다. JmsXA는 실제로 java 접두어로 등록되므로 전역 네임 스페이스에 포함되지 않으며 해당 조회가 정상적으로 작동합니다. – Mauli

0

나는 HornetQ를 사용하지 않았다. 나는 단지 질문을 위해서 tutorial on setting up Spring together with HornetQ을 읽었다. 이 섹션에는 jndi.properties을 설정하는 방법에 대한 섹션이 있습니다. 아마 HornetQ가 JBoss JNDI 컨텍스트에 내용을 등록하는지 확인해야 할 것입니다.

파일을 제안했는데 올바르게 배치 되었습니까?

관련 문제