0

我有一个使用带 HornetMQ 的 WF-8 运行的 Java EE 项目:--- 服务器端被部署为一个 .ear 包。--- 客户端是一个 Java GUI,它通过 JMS 消息传递与服务器进行通信。

收起时一切正常。

我正在尝试使用带有 ArtemisMQ 的 WF-10 来复活它,这让我很生气。

清除所有处理 Hornet -> Artemis 的异常后,我的位置如下:

--- WF 控制台确认 gotest.ear 部署没有异常。(控制台输出粘贴在下面)

--- 客户端的 Eclipse 控制台输出确认它有一个连接并且它发送了一个对象消息。(我的格式化输出粘贴在下面)

--- Standalone-full.xml 显示了我的 MDB 侦听的队列配置。AND WF 浏览器控制台双重确认。(WF的配置信息也贴在下面)

但是我的 MDB 根本不会写入或登录到 WF 控制台。即甚至不是来自它的构造方法。而且它的 onMessage() 对客户端发送的消息完全没有响应。

我很无助,因为我没有在任何地方得到异常来暗示出了什么问题。

谁能指出我正确的方向?帮助!!

MDB 代码(我已经把它切到了骨头,直到我可以让它写入或登录到 WF 控制台,承认它正在收听消息。)

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.ejb.MessageDrivenContext;
import javax.enterprise.context.ApplicationScoped;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.persistence.Transient;
import org.apache.log4j.Logger;

@MessageDriven(
    activationConfig ={  
      @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"), 
      @ActivationConfigProperty(propertyName="destination", propertyValue="jms/queue/sendToServerQueue"),
      @ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue = "Auto-acknowledge"),
      })

public class GoMsgBean implements MessageListener {

  final Logger logger = Logger.getLogger(GoMsgBean.class.getName());

  public GoMsgBean () {
    System.out.println("System.out message FROM GoMsgBean Constructor");
    logger.info("Logger message FROM GoMsgBean Constructor");
  }

  @PostConstruct
  public void myInit () {
    System.out.println("System.out message FROM GoMsgBean PostConstruct");
    logger.info("Logger message FROM GoMsgBean PostConstruct");
      }

  public void onMessage(Message msg) {
    System.out.println("System.out message FROM GoMsgBean onMessage()");
    logger.info("Logger message FROM GoMsgBean onMessage()");
  }
}

独立的完整的.XML

<subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
  <server name="default">
  . . .
    <jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
    <jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
    <jms-queue name="SendToServerQueue" entries="java:jboss/exported/jms/queue/sendToServerQueue"/>
    <jms-queue name="SendToClientQueue2" entries="java:jboss/exported/jms/queue/sendToClientQueue2"/>
    . . .
    <connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="http-connector"/>
    <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
  </server>
</subsystem>

WFLY localhost :9990 控制台配置详细信息

Queues/Topics
Name:         SendToServerQueue
JNDINames:    java:jboss/exported/jms/queue/sendToServerQueue
**Durable?:   true**
Selector:     <blank>

Connection Factories
Name          InVmConnectionFactory
JNDI          java:/ConnectionFactory

Name:         RemoteConnectionFactory 
JNDI          java:jboss/exported/jms/RemoteConnectionFactory

Security Settings
Pattern       #
Role          guest

Address Settings
Pattern       #

Diverts       No Items!

ECLIPSE CONSOLE OUTPUT(当客户端 GUI 打开时)(我添加了疯狂数量的 System.out.printlns 来逐行跟踪正在发生的事情。每个输出字符串都以编写该行的 Class.method () 开头。)

ECLIPSE CONSOLE OUTPUT when Client is opened

MsgCtrSnd.run ()       beg
  MsgCtrSnd.run ()       Requesting InitialContext
        CONNECTION VARIABLES
        key: java.naming.provider.url         value: http-remoting://localhost:8080
        key: java.naming.factory.initial      value: org.jboss.naming.remote.client.InitialContextFactory
        key: java.naming.security.principal   value: jmsUser
        key: java.naming.security.credentials value: jmsUser123!
  MsgCtrSnd.run ()       InitialContext OK: javax.naming.InitialContext@4135c3b
  MsgCtrSnd.run ()       Look up ConnectionFactory with: "jms/RemoteConnectionFactory"
  MsgCtrSnd.run ()       ConnectionFactory: Ok:
                         org.apache.activemq.artemis.jms.client.ActiveMQJMSConnectionFactory
  MsgCtrSnd.run ()       Instantiating Connection
  MsgCtrSnd.run ()       JMS Connection OK:
                         org.apache.activemq.artemis.jms.client.ActiveMQConnection@4d5d943d
Instantiating Session
  MsgCtrSnd.run ()       JMS Session OK: 
                         ActiveMQSession->ClientSessionImpl 
                         [name=212aa734-90f5-11e7-aa7a-a3fb7876c1f2, username=appUser, closed=false, factory = org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl@2a4fb17b, metaData=(jms-session=,)]@368f2016
  MsgCtrSnd.run ()       Lookup Queue w/ JNDI name: ["jms/queue/sendToServerQueue"]
  MsgCtrSnd.run ()       Queue secured: 
                         ActiveMQQueue[SendToServerQueue]IS NOT NULL
  MsgCtrSnd.run ()       Instantiating Message Producer
  MsgCtrSnd.run ()       Message Producer [IS NOT NULL] 
                         ActiveMQMessageProducer->org.apache.activemq.artemis.core.client.impl.ClientProducerImpl@59474f18
  MsgCtrSnd.run ()       Starting jmsConnection
  MsgCtrSnd.run ()       JMS Send Connection : Ok.
MsgCtrSnd.run ()       end

ECLIPSE CONOSOLE OUTPUT (when client GUI is used to send message to log in)

Cntrl.executeMenuAction ()    beg
  Cntrl.executeMenuAction ()    Switching to: Log In
  Cntrl.loginSend ()            beg
    Cntrl.loginSend ()            calling DataDialog.collectData()
    Cntrl.loginSend ()            EntityFieldsCollector ok
    Cntrl.loginSend ()            returned from DataDialog.collectData()
    Cntrl.loginSend ()            EntityFieldsCollector  contains 2 entries. 
    Cntrl.loginSend ()            key: Member ID:           308486  value:         ID
    Cntrl.loginSend ()            key: Member PW            308487  value:         PW
    Cntrl.loginSend ()            message center connection ok
    MsgCtrSnd.sendMsg ()          beg
      MsgCtrSnd.sendMsg ()          Action: Log In
      MsgCtrSnd.sendMsg ()          clientHash: aaaaaa
      MsgCtrSnd.sendMsg ()          memberId   : ID
      MsgCtrSnd.sendMsg ()          memberPw   : PW
      MsgCtrSnd.sendMsg ()          clientUserId   : null
      MsgCtrSnd.sendMsg ()          clientUserPw   : null
      MsgCtrSnd.sendMsg ()          calling createObjectMessage ()
      MsgCtrSnd.sendMsg ()          ObjectMessage instantiated.
      MsgCtrSnd.sendMsg ()          Object Message object: java.util.ArrayList
      MsgCtrSnd.sendMsg ()        message sent.
    MsgCtrSnd.sendMsg ()        end
  Cntrl.loginSend ()          end
Cntrl.executeMenuAction ()  end

启动时部署 GOTEST.EAR 时的狂野控制台输出

Calling "C:\ProgramFilesGeo\Wildfly\wildfly-10.1.0.Final\bin\standalone.conf.bat"
Setting JAVA property to "C:\Program Files\Java\jdk1.8.0_121\bin\java"
===============================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: "C:\ProgramFilesGeo\Wildfly\wildfly-10.1.0.Final"

  JAVA: "C:\Program Files\Java\jdk1.8.0_121\bin\java"

  JAVA_OPTS: "-Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman"

===============================================================================

INFO  [org.jboss.modules] (main) JBoss Modules version 1.5.2.Final
INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.6.Final
INFO  [org.jboss.as] (MSC service thread 1-7) WFLYSRV0049: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) starting
INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
INFO  [org.xnio] (MSC service thread 1-3) XNIO version 3.4.0.Final
INFO  [org.xnio.nio] (MSC service thread 1-3) XNIO NIO Implementation Version 3.4.0.Final
INFO  [org.wildfly.iiop.openjdk] (ServerService Thread Pool -- 42) WFLYIIOP0001: Activating IIOP Subsystem
INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 41) WFLYCLINF0001: Activating Infinispan subsystem.
INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 48) WFLYJSF0007: Activated the following JSF Implementations: [main]
INFO  [org.jboss.as.connector] (MSC service thread 1-4) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.3.4.Final)
INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 52) WFLYNAM0001: Activating Naming Subsystem
INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 62) WFLYWS0002: Activating WebServices Extension
INFO  [org.jboss.as.security] (ServerService Thread Pool -- 59) WFLYSEC0002: Activating Security Subsystem
INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 40) WFLYIO001: Worker 'default' has auto-configured to 16 core threads with 128 task threads based on your 8 available processors
INFO  [org.jboss.as.security] (MSC service thread 1-7) WFLYSEC0001: Current PicketBox version=4.9.6.Final
INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0003: Undertow 1.4.0.Final starting
INFO  [org.jboss.remoting] (MSC service thread 1-5) JBoss Remoting version 4.0.21.Final
INFO  [org.jboss.as.naming] (MSC service thread 1-8) WFLYNAM0003: Starting Naming Service
INFO  [org.jboss.as.mail.extension] (MSC service thread 1-8) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 36) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-7) WFLYJCA0018: Started Driver service with driver-name = h2
INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 36) WFLYJCA0005: Deploying non-JDBC-compliant driver class org.mariadb.jdbc.Driver (version 1.5)
INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) WFLYJCA0018: Started Driver service with driver-name = mysql
INFO  [org.jboss.as.ejb3] (MSC service thread 1-8) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 128 (per class), which is derived from thread worker pool sizing.
INFO  [org.jboss.as.ejb3] (MSC service thread 1-5) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 32 (per class), which is derived from the number of CPUs on this host.
INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 61) WFLYUT0014: Creating file handler for path 'C:\ProgramFilesGeo\Wildfly\wildfly-10.1.0.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0012: Started server default-server.
INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0018: Host default-host starting
INFO  [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0001: Bound data source [java:jboss/jdbc/gotestdb]
INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) WFLYJCA0001: Bound data source [java:jboss/jdbc/tappdb]
INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-4) WFLYMSGAMQ0001: AIO wasn't located on this platform, it will fall back to using pure Java NIO.
WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-2) WFLYDM0111: Keystore C:\ProgramFilesGeo\Wildfly\wildfly-10.1.0.Final\standalone\configuration\application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "GoTest.ear" (runtime-name: "GoTest.ear")
INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) WFLYDS0013: Started FileSystemDeploymentService for directory C:\ProgramFilesGeo\Wildfly\wildfly-10.1.0.Final\standalone\deployments
INFO  [org.wildfly.iiop.openjdk] (MSC service thread 1-3) WFLYIIOP0009: CORBA ORB Service started
INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 64) AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=false,journalDirectory=C:\ProgramFilesGeo\Wildfly\wildfly-10.1.0.Final\standalone\data\activemq\journal,bindingsDirectory=C:\ProgramFilesGeo\Wildfly\wildfly-10.1.0.Final\standalone\data\activemq\bindings,largeMessagesDirectory=C:\ProgramFilesGeo\Wildfly\wildfly-10.1.0.Final\standalone\data\activemq\largemessages,pagingDirectory=C:\ProgramFilesGeo\Wildfly\wildfly-10.1.0.Final\standalone\data\activemq\paging)
INFO  [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-6) ISPN000128: Infinispan version: Infinispan 'Chakra' 8.2.4.Final
INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 64) AMQ221013: Using NIO Journal
INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 66) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 72) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 66) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 71) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 72) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 71) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0207: Starting subdeployment (runtime-name: "GoTest.jar")
INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 64) AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE
INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 64) AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP
INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 64) AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support for: HORNETQ
INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 64) AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: STOMP
INFO  [org.wildfly.extension.undertow] (MSC service thread 1-6) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
INFO  [org.jboss.ws.common.management] (MSC service thread 1-3) JBWS022052: Starting JBossWS 5.1.5.Final (Apache CXF 3.1.6)
INFO  [org.jboss.as.jpa] (MSC service thread 1-8) WFLYJPA0002: Read persistence.xml for GoTestDataBase
INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 71) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'GoTest.ear/GoTest.jar#GoTestDataBase'
INFO  [org.jboss.weld.deployer] (MSC service thread 1-8) WFLYWELD0003: Processing weld deployment GoTest.ear
INFO  [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 71) HHH000204: Processing PersistenceUnitInfo [
        name: GoTestDataBase
        ...]
INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-5) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor acceptor
INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-1) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor acceptor
INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-7) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor-throughput acceptor
INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-2) WFLYMSGAMQ0016: Registered HTTP upgrade for activemq-remoting protocol handled by http-acceptor-throughput acceptor
INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-8) HV000001: Hibernate Validator 5.2.4.Final
INFO  [org.hibernate.Version] (ServerService Thread Pool -- 71) HHH000412: Hibernate Core {5.0.10.Final}
INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 71) HHH000206: hibernate.properties not found
INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 71) HHH000021: Bytecode provider name : javassist
INFO  [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 71) HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 64) AMQ221007: Server is now live
INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 64) AMQ221001: Apache ActiveMQ Artemis Message Broker version 1.1.0.wildfly-017 [nodeID=e2b89808-fdf2-11e6-9f54-3956fe24eb2d]
INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 64) AMQ221003: trying to deploy queue jms.queue.SendToServerQueue
INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 67) AMQ221003: trying to deploy queue jms.queue.DLQ
INFO  [org.wildfly.extension.messaging-activemq] (ServerService Thread Pool -- 72) WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 70) AMQ221003: trying to deploy queue jms.queue.SendToClientQueue2
INFO  [org.wildfly.extension.messaging-activemq] (ServerService Thread Pool -- 65) WFLYMSGAMQ0002: Bound messaging object to jndi name java:/ConnectionFactory
INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 66) AMQ221003: trying to deploy queue jms.queue.ExpiryQueue
INFO  [org.jboss.weld.deployer] (MSC service thread 1-8) WFLYWELD0003: Processing weld deployment GoTest.jar
INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-8) WFLYEJB0473: JNDI bindings for session bean named 'EnrollerBean' in deployment unit 'subdeployment "GoTest.jar" of deployment "GoTest.ear"' are as follows:

        java:global/GoTest/GoTest/EnrollerBean!org.america3.gotest.server.sessionbeans.EnrollerBean
        java:app/GoTest/EnrollerBean!org.america3.gotest.server.sessionbeans.EnrollerBean
        java:module/EnrollerBean!org.america3.gotest.server.sessionbeans.EnrollerBean
        java:global/GoTest/GoTest/EnrollerBean
        java:app/GoTest/EnrollerBean
        java:module/EnrollerBean

INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-8) WFLYEJB0473: JNDI bindings for session bean named 'ExiterBean' in deployment unit 'subdeployment "GoTest.jar" of deployment "GoTest.ear"' are as follows:

        java:global/GoTest/GoTest/ExiterBean!org.america3.gotest.server.sessionbeans.ExiterBean
        java:app/GoTest/ExiterBean!org.america3.gotest.server.sessionbeans.ExiterBean
        java:module/ExiterBean!org.america3.gotest.server.sessionbeans.ExiterBean
        java:global/GoTest/GoTest/ExiterBean
        java:app/GoTest/ExiterBean
        java:module/ExiterBean

INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-8) WFLYEJB0473: JNDI bindings for session bean named 'LoginerBean' in deployment unit 'subdeployment "GoTest.jar" of deployment "GoTest.ear"' are as follows:

        java:global/GoTest/GoTest/LoginerBean!org.america3.gotest.server.sessionbeans.LoginerBean
        java:app/GoTest/LoginerBean!org.america3.gotest.server.sessionbeans.LoginerBean
        java:module/LoginerBean!org.america3.gotest.server.sessionbeans.LoginerBean
        java:global/GoTest/GoTest/LoginerBean
        java:app/GoTest/LoginerBean
        java:module/LoginerBean

INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-8) WFLYEJB0473: JNDI bindings for session bean named 'LogouterBean' in deployment unit 'subdeployment "GoTest.jar" of deployment "GoTest.ear"' are as follows:

        java:global/GoTest/GoTest/LogouterBean!org.america3.gotest.server.sessionbeans.LogouterBean
        java:app/GoTest/LogouterBean!org.america3.gotest.server.sessionbeans.LogouterBean
        java:module/LogouterBean!org.america3.gotest.server.sessionbeans.LogouterBean
        java:global/GoTest/GoTest/LogouterBean
        java:app/GoTest/LogouterBean
        java:module/LogouterBean

INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-8) WFLYEJB0473: JNDI bindings for session bean named 'ReplierBean' in deployment unit 'subdeployment "GoTest.jar" of deployment "GoTest.ear"' are as follows:

        java:global/GoTest/GoTest/ReplierBean!org.america3.gotest.server.sessionbeans.ReplierBean
        java:app/GoTest/ReplierBean!org.america3.gotest.server.sessionbeans.ReplierBean
        java:module/ReplierBean!org.america3.gotest.server.sessionbeans.ReplierBean
        java:global/GoTest/GoTest/ReplierBean
        java:app/GoTest/ReplierBean
        java:module/ReplierBean

INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-5) WFLYJCA0007: Registered connection factory java:/JmsXA
INFO  [org.apache.activemq.artemis.ra] (MSC service thread 1-5) Resource adaptor started
INFO  [org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-5) IJ020002: Deployed: file://RaActivatoractivemq-ra
INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-4) WFLYJCA0002: Bound JCA ConnectionFactory [java:/JmsXA]
INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-2) WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/DefaultJMSConnectionFactory
INFO  [org.jboss.weld.Version] (MSC service thread 1-8) WELD-000900: 2.3.5 (Final)
INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 71) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
INFO  [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 71) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.
INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 66) WFLYJPA0010: Starting Persistence Unit (phase 2 of 2) Service 'GoTest.ear/GoTest.jar#GoTestDataBase'
INFO  [org.jboss.as.ejb3] (MSC service thread 1-8) WFLYEJB0042: Started message driven bean 'GoMsgBean' with 'activemq-ra.rar' resource adapter
INFO  [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 66) HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
INFO  [org.hibernate.envers.boot.internal.EnversServiceImpl] (ServerService Thread Pool -- 66) Envers integration enabled? : true
INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 71) WFLYCLINF0002: Started client-mappings cache from ejb container

Member.<init>................................beg
  Member.<init>................................Hello World. See! I can Log messages again.
Member.<init>................................end

INFO  [org.hibernate.hql.internal.QueryTranslatorFactoryInitiator] (ServerService Thread Pool -- 66) HHH000397: Using ASTQueryTranslatorFactory
INFO  [org.jboss.as.server] (ServerService Thread Pool -- 37) WFLYSRV0010: Deployed "GoTest.ear" (runtime-name : "GoTest.ear")
INFO  [org.apache.activemq.artemis.ra] (default-threads - 1) AMQ151000: awaiting topic/queue creation jms/queue/sendToServerQueue
INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started in 5392ms - Started 691 of 931 services (430 services are lazy, passive or on-demand)

部署后的疯狂控制台输出似乎是个问题。注意:下一个 INFO 行说 jms/queue/sendToServerQueue 不是持久的,而 WF 控制台说它配置为持久)

INFO  [org.apache.activemq.artemis.ra] (default-threads - 1) AMQ151001: Attempting to reconnect org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec(ra=org.apache.activemq.artemis.ra.ActiveMQResourceAdapter@78712571 destination=jms/queue/sendToServerQueue destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false clientID=null user=null maxSession=15)

This is in reference to J. R. Perkins below concerning whether there was a log4j.xml in the deployment. This is another excerpt from WF’s standalone-full.xml I use for logging if I can ever get my MDB to even write to System.out:

<profile>
  <subsystem xmlns="urn:jboss:domain:logging:3.0">
    <console-handler name="CONSOLE">
      <level name="INFO"/>
        <formatter><named-formatter name="COLOR-PATTERN"/></formatter>
    </console-handler>
    <console-handler name="MY-CONSOLE" autoflush="true">
      <formatter><named-formatter name="MY-PATTERN"/></formatter>
      <target name="System.out"/>
    </console-handler>
    <console-handler name="GOTEST-HANDLER">
      <level name="INFO"/>
        <formatter><named-formatter name="GOTEST-PATTERN"/></formatter>
    </console-handler>
    . . .
    <logger category="org.america3.gotest" use-parent-handlers="false">
      <level name="ALL"/>
      <handlers><handler name="GOTEST-HANDLER"/></handlers>
    </logger>
    <logger category="com.arjuna">
      <level name="WARN"/>
    </logger>
    <logger category="org.jboss.as.config">
      <level name="DEBUG"/>
    </logger>
    <logger category="sun.rmi">
      <level name="WARN"/>
    </logger>
    <root-logger>
      <level name="INFO"/>
        <handlers><handler name="CONSOLE"/><handler name="FILE"/></handlers>
    </root-logger>
    <formatter name="PATTERN">
      <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
    </formatter>
    <formatter name="COLOR-PATTERN">
      <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
    </formatter>
    <formatter name="MY-PATTERN">
      <pattern-formatter pattern="MeMeMe%s%n"/>
    </formatter>
    <formatter name="GOTEST-PATTERN">
      <pattern-formatter pattern="%s%n"/>
    </formatter>
  </subsystem>
  . . . 
</profile>
4

1 回答 1

0

我相信问题记录在这里:

INFO  [org.apache.activemq.artemis.ra] (default-threads - 1) AMQ151000: awaiting topic/queue creation jms/queue/sendToServerQueue

换句话说,MDB 没有完全激活,因为它找不到目标“jms/queue/sendToServerQueue”。我相信这是因为您没有正确定义 JNDI 绑定(因为您只定义了一个“导出”条目)。尝试使用这个:

<jms-queue name="SendToServerQueue" entries="java:jboss/exported/jms/queue/sendToServerQueue java:/jms/queue/sendToServerQueue"/>

诊断此类问题需要做的事情:

  1. 仔细阅读日志以获取有用信息。
  2. 检查 MDB 应该从中接收消息的队列的 consumerCount。如果为 0,则表示 MDB 存在问题。
于 2017-09-07T15:56:58.610 回答