現在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:ライブメッセージブローカは、ブローカ構成(clustered = false、journalDirectory = D:\ projects \ MCG \ Software \ wildfly-10.1.0.Final \ standalone)で開始しています。 \ data \ activemq \ journal、bindingsDirectory = D:¥projects¥MCG¥Software¥wildfly-10.1.0.Final¥standalone¥data¥activemq¥bindings、largeMessagesDirectory = D:¥projects¥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メッセージブローカーバージョン1.1.0.wildfly-017 [nodeID = a3b04b10-d656-11e6-8bd3-c391bfc23687]
...
17:09:28,888情報[org.wildfly.ex 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](MSCサービススレッド1-5) WFLYEJB0042: 'activemq-ra.rar'リソースアダプタを含むメッセージ駆動型Bean 'EmailDispatchMDB'を起動しました
...
17:09:56,420 WARN [org.apache.activemq.artemis.ra](default-threads - 5)AMQ152005:ブローカ起動時の失敗org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec(ra = org.apache.activemq.artemis.ra.ActiveMQResourceAd apec @ 78712571 destination = java:/ bbl/OutboundEmailQueue destinationType = javax.jms.Queue ack =自動確認応答=偽クライアントID = nullユーザー= null maxSession = 15):java.lang.ClassCastException:com.MCG.bbl.email .dispatcher.EmailDispatchMDB $$$ endpoint2はjavax.resource.spi.endpoint.MessageEndpointにキャストできません at org.jboss.as.ejb3.inflow.JBossMessageEndpointFactory.createEndpoint(JBossMessageEndpointFactory.java:75) at 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) at org.jboss.threads.QueueExecutor $ Worker.run(QueueExecutor.java:828) java.lang.Thread.run(Thread.java:744) at org.jboss .threads.JBossThread.run(JBossThread.java:320)
...
17:09:58488 INFO [org.apache.activemq.artemis.ra](デフォルト-スレッド - 5)AMQ151001:しようorg.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec(ra = org.apache.activemq.artemis.ra.Active)を再接続するMQResourceAdapter @ 78712571宛先= java:/ bbl/OutboundEmailQueue destinationType = javax.jms.Queue ack =自動確認応答=耐久性= falseクライアントID = nullユーザー= null maxSession = 15)
...
17:09:58,693エラー[ 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 =自動肯定応答永続性= false clientID = nullユーザー= null maxSession = 15):java.lang.ClassCastException:com.mcg.bbl.email.dispatcher .EmailDispatchMDB $$$ endpoint2はjavax.resource.spi.endpoint.MessageEndpointにキャストできません at org.jboss.as.ejb3.inflow.JBossMessageEndpointFactory.createEndpoint(JBossMessageEndpointFactory.java:75) at org.jboss.as.ejb 3.inflow.JBossMessageEndpointFactory.createEndpoint(JBossMessageEndpointFactory.java:63) at org.apache.activemq.artemis.ra.inflow.ActiveMQMessageHandler.setup(ActiveMQMessageHandler.java:187) at org.apache.activemq.artemis.ra。 (ActiveMQActivation.java:678) at org.apache.activemq.artemis.ra.inflow.ActiveMQActivation.reconnect(ActiveMQActivation.java:678) at 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) at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808) at org.jboss.t hreads.QueueExecutor.access $ 100(QueueExecutor.java:45) at 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