JMS 从 JBoss 5.1 GA 迁移到 EAP 6.4

JMS migration from JBoss 5.1 GA to EAP 6.4

我的 JBoss 5.1 网络应用程序兼容:

public class SendNotification {

    @Resource(mappedName="queue/QueueNotification")
    private Queue destination;
    @Resource(mappedName="ConnectionFactory")
    private QueueConnectionFactory connectionFactory;

    public void sendMessageToDestination(Mymessage message) {
        connection = connectionFactory.createConnection();
        sessione = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageProducer producer = sessione.createProducer(destination);
        ObjectMessage message = sessione.createObjectMessage();
        message.setObject(messaggio);
        ..
        producer.send(...
    }

    ...
}

我正在尝试迁移到 JBoss EAP 6,但在部署时我收到此错误:

SendNotification \".destination is missing

然后我尝试配置 standalone-full.xml 为:

<jms-destinations>                  
    <jms-queue name="MyAppQueueNotification">
        <entry name="java:/jms/queue/MyAppQueueNotification"/>                        
    </jms-queue>                    
    ...

但是什么都没变...怎么了?

希望 link 对您有所帮助:Migration 第 3.1.8.4 节。

请尝试将@Resource(mappedName="queue/QueueNotification")更改为@Resource(mappedName="java:/queue/QueueNotification")