0

当我在 JBoss 5 上部署我的应用程序时,会在启动 QueueService 之前创建 EJB。由于队列尚不可用,消息驱动 bean 的创建现在惨遭失败:

17:11:29,151 INFO  [EJBContainer] STARTED EJB: .....
17:11:29,266 INFO  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
..
..
17:11:29,928 WARN  [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@11694c ...
javax.naming.NameNotFoundException: ... not bound
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
    at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at org.jboss.util.naming.Util.lookup(Util.java:222)
    at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupDestination(JmsActivation.java:464)
    at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:352)
    at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:729)
    at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:213)
    at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
17:11:30,027 INFO  [QueueService] Queue[/queue/....] started, fullSize=200000, pageSize=2000, downCacheSize=2000

如何配置部署顺序?

4

2 回答 2

1

自己找到了答案。我在消息驱动 bean 中添加了以下注释:

@Depends({"jboss.messaging.destination:service=Topic,name=XxxxTopic"})
于 2009-03-26T12:25:46.360 回答
1

<?xml version="1.0" encoding="UTF-8"?>

<!--
     Null persistence config.

     Use this if you don't actually want to persist anything

     $Id$
 -->

<server>

   <!-- Persistence Manager MBean configuration
       ======================================== -->

   <mbean code="org.jboss.messaging.core.jmx.NullPersistenceManagerService"
      name="jboss.messaging:service=PersistenceManager"
      xmbean-dd="xmdesc/NullPersistenceManager-xmbean.xml"/>

   <!-- Messaging Post Office MBean configuration
        ========================================= -->

   <mbean code="org.jboss.messaging.core.jmx.MessagingPostOfficeService"
      name="jboss.messaging:service=PostOffice"
      xmbean-dd="xmdesc/MessagingPostOffice-xmbean.xml">

      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
      <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>

      <!-- The name of the post office -->

      <attribute name="PostOfficeName">JMS post office</attribute>

      <!-- This post office is clustered. If you don't want a clustered post office then set to false -->

      <attribute name="Clustered">false</attribute>

   </mbean>

   <!-- Messaging JMS User Manager MBean config
        ======================================= -->

   <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
      name="jboss.messaging:service=JMSUserManager"
      xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
        <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends> 
   </mbean>

</server>

将此保存为“null-persistence-service.xml”并将此部署/消息传递/

现在它可以工作了

于 2012-01-19T10:08:11.207 回答