【发布时间】:2014-04-22 05:27:05
【问题描述】:
我已经创建了一个客户端和服务器的 JMS 项目。我的客户端是一个简单的 Java 应用程序,而服务器是一个 Web 应用程序。当我使用客户端发送消息时,服务器上出现错误。
2014-03-12 17:00:52,991 WARN [org.hornetq.core.protocol.core.impl.RemotingConnectionImpl] (hornetq-failure-check-thread) 检测到连接失败:没有从 / 接收数据10.1.20.219:63869。很可能客户端在没有关闭连接的情况下退出或崩溃,或者服务器和客户端之间的网络出现故障。您也可能错误地配置了 connection-ttl 和 client-failure-check-period。请查看用户手册了解更多信息。现在将关闭连接。 [代码=3] 2014-03-12 17:00:52,994 WARN [org.hornetq.core.server.impl.ServerSessionImpl](hornetq-failure-check-thread)客户端连接失败,清除会话 7ccb43c0-a9d9-11e3-8873-的资源0024e8c8aec3 2014-03-12 17:00:52,995 WARN [org.hornetq.core.server.impl.ServerSessionImpl] (hornetq-failure-check-thread) 清除了会话 7ccb43c0-a9d9-11e3-8873-0024e8c8aec3* 的资源p>
客户端发送的所有消息都出现在队列中。但是我的 MDB bean 没有响应。请帮忙。
Bean 代码
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.*;
/**
* Created by manodyas on 3/12/14.
*/
@MessageDriven(mappedName = "MsgBean.java", activationConfig = {
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination",propertyValue = "/queue/TestABC"),
@ActivationConfigProperty(propertyName = "clientFailureCheckPeriod", propertyValue = "600000"),
@ActivationConfigProperty(propertyName = "connectionTTL", propertyValue = "-1")
})
//@MessageDriven(activationConfig = {@ActivationConfigProperty(propertyName = "destinationType",propertyValue = "javax.jms.Queue"),@ActivationConfigProperty(propertyName = "destination",propertyValue = "queue/TestABC") })
class MsgBean implements MessageListener{
public MsgBean()
{
}
public void onMessage(Message message)
{
System.out.println("test");
if (message instanceof TextMessage)
{
System.out.println("Order Accepted...!!");
}
else
{
System.out.println("Other..");
}
}
}
【问题讨论】: