2017-01-19 83 views
0

我正在将运行在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 AMQ221000:活动Message Broker以配置Broker配置开始(clustered = false,journalDirectory = D:\ projects \ MCG \ Software \ wildfly-10.1.0.Final \ standalone \数据\ ActiveMQ的\轴颈,bindingsDirectory = d:\项目\ MCG \ SOFTWARE \ wildfly-10.1.0.Final \独立\数据\ ActiveMQ的\绑定,largeMes​​sagesDirectory = 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 WFLYMSGAMQ0002:将消息传递对象绑定到jndi名称java:jboss/exported/jms/RemoteConnectionFactory 17:09:28,898 INFO [org.apache.activemq.artemis.core.server(服务器服务线程池 - 72) ](ServerService Thread Pool - 73)AMQ221003:试图部署队列jms.queue.OutboundEmailQueue

...

17:09:49,857 INFO [org.jboss.as.ejb3](MSC service thread 1-5) WFLYEJB0042:启动消息驱动bean 'EmailDispatchMDB' 与 'ActiveMQ的-ra.rar,或许' 资源适配器

...

17:09:56420警告[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 =自动确认持久= false clientID = null user = 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) 在org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33) 在org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808) 在org.jboss.threads.QueueExecutor。在org.jboss.threads.QueueExecutor上访问$ 100(QueueExecutor.java:45) (java.lang.Thread.run(Thread.java:744) .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 destination = java:/ bbl/OutboundEmailQueue destinationType = javax.jms.Queue ack =自动确认持续= false clientID = null user = null maxSession = 15)

...

17:09:58,693错误[ org.apache.activemq.artemis.ra](默认线程 - 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 =自动确认持续= false clientID = null user = null maxSession = 15):java.lang.ClassCastException:com.mcg.bbl.email.dispatcher .EmailDispatchMDB $$$的端点2不能转换为org.jboss.as.ejb3.inflow.JBossMessageEndpointFactory.createEndpoint(JBossMessageEndpointFactory.java:75) 的org.jboss.as.ejb处的javax.resource.spi.endpoint.MessageEndpoint 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。 inforg.ActiveMQActivation.setup(ActiveMQActivation.java:318) at org.apache.activemq.artemis.ra.inflow.ActiveMQActivation.reconnect(ActiveMQActivation.java:678) at org.apache.activemq.artemis.ra.inflow。在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) at java.lang.Thread.run(Thread.java:744) at org.jboss.threads.JBossThread.run(JBossThread.java:320)

+0

在询问查询之前,您可能需要参考http://stackoverflow.com/help/how-to-ask – Prasad

回答

0

这个问题已解决,它是与jar相关的问题。由于我从jboss 6升级到wildfly 10,不知何故该项目引用jar“jboss-connector-api_1.5_spec-1.0.0.Final.jar”,这是jboss 6特有的。我纠正了这种依赖关系,并配置了正确的模块“ javax.resource.api“,它有最新的jar”jboss-connector-api_1.7_spec-1.0.0.Final.jar“,并且错误得到解决。

所以结论是项目指的是旧版本的jar需要纠正。

希望这有助于!

相关问题