如何配置JBoss服务的启动顺序(JmsActivation)

发布于 2024-07-16 04:34:55 字数 1844 浏览 11 评论 0原文

当我在 JBoss 5 上部署应用程序时,EJB 是在 QueueService 启动之前创建的。 由于队列尚不可用,消息驱动 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

如何配置部署顺序?

When I deploy my application on JBoss 5 the EJBs are created before the QueueService is started. Creation of Message Driven beans now fails miserably because the queues are not yet available:

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

How can the deploy sequence be configured?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

萧瑟寒风 2024-07-23 04:34:55

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

@Depends({"jboss.messaging.destination:service=Topic,name=XxxxTopic"})

Found the answer myself. I added the following annotation to the message driven bean:

@Depends({"jboss.messaging.destination:service=Topic,name=XxxxTopic"})
一抹苦笑 2024-07-23 04:34:55
<?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”并将其放入部署/消息传递/

现在它可以工作了

<?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>

save this as 'null-persistence-service.xml' and put this deploy/messaging/

Now it will works

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文