问题描述
今天写了一个MessageDerviceBean但是,服务器就是不能创建这个消息驱动bean,也没出现异常。。或者错误,代码如下:=============================================================================================================packagecom.fbd.mdb;importjavax.ejb.ActivationConfigProperty;importjavax.ejb.MessageDriven;importjavax.jms.JMSException;importjavax.jms.Message;importjavax.jms.MessageListener;importjavax.jms.TextMessage;/***Message-DrivenBeanimplementationclassfor:FirstMDB**/@MessageDriven(activationConfig={@ActivationConfigProperty(propertyName="destinationType",propertyValue="javax.jms.Queue"),@ActivationConfigProperty(propertyName="destination",propertyValue="queue/testQueue")})publicclassFirstMDBimplementsMessageListener{/***Defaultconstructor.*/publicFirstMDB(){}/***@seeMessageListener#onMessage(Message)*/publicvoidonMessage(Messagemessage){try{if(messageinstanceofTextMessage){System.out.println("测试是否执行!");TextMessagemsg=(TextMessage)message;System.out.println(msg.getText());}}catch(JMSExceptione){e.printStackTrace();}}}服务器正常启动消息:==============================================================================================================14:21:41,468INFO[D]BoundtoJNDIname:queue/D14:21:41,468INFO[ex]BoundtoJNDIname:queue/ex14:21:41,484INFO[testTopic]BoundtoJNDIname:topic/testTopic14:21:41,484INFO[securedTopic]BoundtoJNDIname:topic/securedTopic14:21:41,484INFO[testDurableTopic]BoundtoJNDIname:topic/testDurableTopic14:21:41,484INFO[testQueue]BoundtoJNDIname:queue/testQueue14:21:41,500INFO[UILServerILService]JBossMQUILserviceavailableat:localhost/127.0.0.1:809314:21:41,515INFO[DLQ]BoundtoJNDIname:queue/DLQ14:21:41,593INFO[ConnectionFactoryBindingService]BoundConnectionManager'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA'toJNDIname'java:JmsXA'14:21:41,625INFO[ConnectionFactoryBindingService]BoundConnectionManager'jboss.jca:service=DataSourceBinding,name=MySqlDS'toJNDIname'java:MySqlDS'14:21:41,671INFO[TomcatDeployer]deploy,ctxPath=/jmx-console,warUrl=.../deploy/jmx-console.war/14:21:41,796INFO[Http11BaseProtocol]StartingCoyoteHTTP/1.1onhttp-localhost%2F127.0.0.1-808014:21:41,843INFO[ChannelSocket]JK:ajp13listeningonlocalhost/127.0.0.1:800914:21:41,859INFO[JkMain]JkrunningID=0time=0/31config=null14:21:41,859INFO[Server]JBoss(MXMicroKernel)[4.0.4.GA(build:CVSTag=JBoss_4_0_4_GAdate=200605151000)]Startedin9s:406ms=============================================================================================================主要问题是有消息到队列中去了,服务器这边的消息驱动bean没有创建出来,也没有处理。。。