Я переношу старое приложение, которое работает на Jboss 6.1.0 в настоящее время на wildfly 10.1.0.
Я создал всю очередь из старого приложения в стандартную конфигурацию standalone-full.xml. Но при запуске сервера я получаю сообщение «невозможно передать в javax.resource.spi.endpoint.MessageEndpoint». Я также добавил фрагмент кода, который бросает эту ошибку.
Любая идея, что я делаю неправильно?
автономный-full.xml
...
...
<subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
<server name="default">
<security-setting name="#">
<role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
</security-setting>
<address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/>
<address-setting name="jms.queue.InboundNotificationResponseQueue" dead-letter-address="jms.queue.bblDeadLetterQueue" expiry-address="jms.queue.bblExpiryQueue"/>
<address-setting name="jms.queue.EventDispatchQueue" dead-letter-address="jms.queue.bblDeadLetterQueue" expiry-address="jms.queue.bblExpiryQueue"/>
<address-setting name="jms.queue.OutboundEmailQueue" dead-letter-address="jms.queue.bblDeadLetterQueue" expiry-address="jms.queue.bblExpiryQueue"/>
<http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
<http-connector name="http-connector-throughput" socket-binding="http" endpoint="http-acceptor-throughput">
<param name="batch-delay" value="50"/>
</http-connector>
<in-vm-connector name="in-vm" server-id="0"/>
<http-acceptor name="http-acceptor" http-listener="default"/>
<http-acceptor name="http-acceptor-throughput" http-listener="default">
<param name="batch-delay" value="50"/>
<param name="direct-deliver" value="false"/>
</http-acceptor>
<in-vm-acceptor name="in-vm" server-id="0"/>
<jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
<jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
<jms-queue name="bblDeadLetterQueue" entries="java:/bbl/bblDeadLetterQueue"/>
<jms-queue name="OutboundEmailQueue" entries="java:/bbl/OutboundEmailQueue"/>
<jms-queue name="InboundNotificationResponseQueue" entries="java:/bbl/InboundNotificationResponseQueue"/>
<jms-queue name="EventDispatchQueue" entries="java:/bbl/EventDispatchQueue"/>
<jms-queue name="bblExpiryQueue" entries="java:/bbl/bblExpiryQueue"/>
<connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
<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>
...
...
Код: EmailDispatchMDB.java
package com.mcg.bbl.email.dispatcher;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Resource;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.EJB;
import javax.ejb.MessageDriven;
import javax.ejb.MessageDrivenContext;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;
import org.apache.commons.lang.time.StopWatch;
import org.apache.log4j.Logger;
@MessageDriven(name = "EmailDispatchMDB", activationConfig = {
@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
@ActivationConfigProperty(propertyName="destination", propertyValue="java:/bbl/OutboundEmailQueue")
})
public class EmailDispatchMDB implements MessageListener {
private static final Logger LOG = Logger.getLogger(EmailDispatchMDB.class);
@Resource
private MessageDrivenContext context;
@EJB(mappedName="bbl-server/NotificationService/remote")
private NotificationService notificationService;
public EmailDispatchMDB(){
}
public void finalize() throws Throwable {
}
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void onMessage(Message message) {
/* Custom Code */
}
}
Вход Заявления:
17: 09: 21506 INFO [ org.apache.activemq.a rtemis.core.server] (пул потоков ServerService - 64) AMQ221000: live Message Брокер начинается с конфигурации Конфигурация брокера (clustered = false, journalDirectory = D: \ projects \ MCG \ Software \ wildfly.10.1.0.Final \ standalone \ Data \ ActiveMQ \ журнал, bindingsDirectory = D: \ проекты \ MCG \ Software \ wildfly-10.1.0.Final \ автономные \ Data \ ActiveMQ \ привязок, largeMessagesDirectory = D: \ проекты \ MCG \ Software \ wildfly-10.1.0 .Final \ standalone \ data \ activemq \ largemessages, pagingDirectory = D: \ projects \ MCG \ Software \ wildfly.10.1.0.Final \ standalone \ data \ activemq \ paging)
...
17: 09: 28,604 INFO [org.apache.activemq.artemis.core.server] (пул потоков ServerService - 64) AMQ221001: Apache ActiveMQ Artemis Message Broker версия 1.1.0.wildfly-017 [nodeID = a3b04b10-d656-11e6-8bd3-c391bfc23687]
...
17: 09: 28,888 INFO [org.wildfly.ex tensionMessaging-activemq] (пул потоков ServerService - 72) WFLYMSGAMQ0002: связанный объект обмена сообщениями с jndi именем java: jboss/exported/jms/RemoteConnectionFactory 17: 09: 28,898 INFO [org.apache.activemq.artemis.core.server ] (Пул потоков ServerService - 73) AMQ221003: попытка развертывания очереди jms.queue.OutboundEmailQueue
...
17: 09: 49,857 INFO [org.jboss.as.ejb3] (поток обслуживания 1-5 MSC) WFLYEJB0042: Started управляемый сообщениями бин 'EmailDispatchMDB' с 'ActiveMQ-ra.rar' ресурс адаптер
...
17: 09: 56420 WARN [org.apache.activemq.artemis.ra] (по умолчанию-темы - 5) AMQ152005: Отказ в активации брокера org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec (ra = org.apache.activemq.artemis.ra.ActiveMQResourceAd apter @ 78712571 destination = java:/bbl/OutboundEmailQueue destinationType = javax.jms.Queue ack = Автоматическое подтверждение durable = false clientID = null user = null maxSession = 15): java.lang.ClassCastException: com.MCG.bbl.email .dispatcher.EmailDispatchMDB $$$ endpoint2 нельзя передать в javax.resource.spi.endpoint.MessageEndpoint на org.jboss.as.ejb3.inflow.JBossMessageEndpointFactory.createEndpoint (JBossMessageEndpointFactory.java:75) на org.jboss.as .ejb3.inflow.JBossMessageEndpointFactory.createEndpoint (JBossMessageEndpointFactory.java:63) at org.apache.activemq.artemis.ra.inflow.ActiveMQMessageHandler.setup (ActiveMQMessageHandler.java:187) at org.apache.activemq.artemis.ra .inflow.ActiveMQActivation.setup (ActiveMQActivation.java:318) at org.apache.activemq.artemis.ra.inflow.ActiveMQActivation $ SetupActivation.run (ActiveMQActivation.java : 719) at org.jboss.jca.core.workmanager.WorkWrapper.run (WorkWrapper.java: 223) at org.jboss.threads.SimpleDirectExecutor.execute (SimpleDirectExecutor.java:33) at org.jboss.threads.QueueExecutor.runTask (QueueExecutor.java:808) at org.jboss.threads.QueueExecutor. доступ $ 100 (QueueExecutor.java:45) на org.jboss.threads.QueueExecutor $ Worker.run (QueueExecutor.java:828) на java.lang.Thread.run (Thread.java:744) на org.jboss .threads.JBossThread.run (JBossThread.java:320)
...
17: 09: 58,488 INFO [org.apache.activemq.artemis.ra] (по умолчанию-темы - 5) AMQ151001: Попытка повторно подключить org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec (ra = org.apache.activemq.artemis.ra.Active MQResourceAdapter @ 78712571 destination = java:/bbl/OutboundEmailQueue destinationType = javax.jms.Queue ack = Автоматическое подтверждение durable = false clientID = null user = null maxSession = 15)
...
17: 09: 58,693 ОШИБКА [ org.apache.activemq.artemis.ra] (default-threads - 5) AMQ154003: Не удалось повторно подключить org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec (ra = org.apache.activemq.artemis.ra.ActiveMQResourceAdapter @ 78712571 destination = java:/bbl/OutboundEmailQueue destinationType = javax.jms.Queue ack = Автоматическое подтверждение durable = false clientID = null user = null maxSession = 15): java.lang.ClassCastException: com.mcg.bbl.email.dispatcher .EmailDispatchMDB $$$ endpoint2 нельзя передать в javax.resource.spi.endpoint.MessageEndpoint на org.jboss.as.ejb3.inflow.JBossMessageEndpointFactory.createEndpoint (JBossMessageEndpointFactory.java:75) на org.jboss.as.ejb 3.inflow.JBossMessageEndpointFactory.createEndpoint (JBossMessageEndpointFactory.java:63) at org.apache.activemq.artemis.ra.inflow.ActiveMQMessageHandler.setup (ActiveMQMessageHandler.java:187) на org.apache.activemq.artemis.ra. inflow.ActiveMQActivation.setup (ActiveMQActivation.java:318) at org.apache.activemq.artemis.ra.inflow.ActiveMQActivation.reconnect (ActiveMQActivation.java:678) по адресу org.apache.activemq.artemis.ra.inflow. ActiveMQActivation $ SetupActivation.run (ActiveMQActivation.java:722) at org.jboss.jca.core.workmanager.WorkWrapper.run (WorkWrapper.java:223) at org.jboss.threads.SimpleDirectExecutor.execute (SimpleDirectExecutor.java: 33) на org.jboss.threads.QueueExecutor.runTask (QueueExecutor.java:808) на org.jboss.t hreads.QueueExecutor.access $ 100 (QueueExecutor.java:45) на org.jboss.threads.QueueExecutor $ Worker.run (QueueExecutor.java:828) на java.lang.Thread.run (Thread.java:744) на org.jboss.threads.JBossThread.run (JBossThread.java:320)
Возможно, вам придется обратиться к этому вопросу, прежде чем задавать запрос http://stackoverflow.com/help/how-to-ask – Prasad