EJB不能创建消息驱动bean
今天写了一个MessageDerviceBean但是,服务器就是不能创建这个消息驱动bean,也没出现异常。。或者错误,代码如下:
=============================================================================================================
package com.fbd.mdb;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
/**
* Message-Driven Bean implementation class for: FirstMDB
*
*/
@MessageDriven(
activationConfig = { @ActivationConfigProperty(
propertyName = "destinationType", propertyValue = "javax.jms.Queue"
) , @ActivationConfigProperty(propertyName="destination",propertyValue="queue/testQueue")})
public class FirstMDB implements MessageListener {
/**
* Default constructor.
*/
public FirstMDB() {
}
/**
* @see MessageListener#onMessage(Message)
*/
public void onMessage(Message message) {
try{
if(message instanceof TextMessage){
System.out.println("测试是否执行!");
TextMessage msg = (TextMessage)message;
System.out.println(msg.getText());
}
}catch(JMSException e){
e.printStackTrace();
}
}
}
服务器正常启动消息:
==============================================================================================================
14:21:41,468 INFO [D] Bound to JNDI name: queue/D
14:21:41,468 INFO [ex] Bound to JNDI name: queue/ex
14:21:41,484 INFO [testTopic] Bound to JNDI name: topic/testTopic
14:21:41,484 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
14:21:41,484 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
14:21:41,484 INFO [testQueue] Bound to JNDI name: queue/testQueue
14:21:41,500 INFO [UILServerILService] JBossMQ UIL service available at : localhost/127.0.0.1:8093
14:21:41,515 INFO [DLQ] Bound to JNDI name: queue/DLQ
14:21:41,593 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
14:21:41,625 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=MySqlDS' to JNDI name 'java:MySqlDS'
14:21:41,671 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
14:21:41,796 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080
14:21:41,843 INFO [ChannelSocket] JK: ajp13 listening on localhost/127.0.0.1:8009
14:21:41,859 INFO [JkMain] Jk running ID=0 time=0/31 config=null
14:21:41,859 INFO [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)] Started in 9s:406ms
=============================================================================================================
主要问题是有消息到队列中去了,服务器这边的消息驱动bean没有创建出来,也没有处理。。。
补充:企业软件 , 企业信息化