[jboss-user] [JBoss Messaging] - MessageDriven Bean annotation problem
jameshartell
do-not-reply at jboss.com
Wed Jul 29 06:03:53 EDT 2009
Hi, I am reading JBoss in Action to try to learn how to use JBoss Messaging and I am going through the examples in the book but I have come stuck on one example and have scoured the web for documentation but couldn't find any so I am writing in my first ever forum for help.
Here is the code:
package org.jbia.jms.sofaspuds;
import javax.jms.*;
import javax.ejb.*;
@MessageDriven(activationConfig={
@ActivationConfigProperty
(propertyName="destinationType", propertyValue="javax.jms.Topic"),
@ActivationConfigProperty
(propertyName="destination", propertyValue="topic/VideoSubscribeTopic"),
@ActivationConfigProperty
(propertyName="subscriptionDurability", propertyValue="Durable"),
@ActivationConfigProperty
(propertyName="messageSelector", propertyValue="SpudsCustomer = 'James'")
})
public class WireTap implements MessageListener {
public void onMessage(Message msg){
try{
ObjectMessage objmsg = (ObjectMessage)msg;
Video video = (Video)objmsg.getObject();
System.out.println("Serveillance: perp=" +
msg.getStringProperty("SpudsCustomer" +
",video = " + video));
}catch (Exception e){
e.printStackTrace();
}
}
}
I have jboss-ejb3x.jar, jboss-j2ee.jar and jboss-messaging-client.jar on the build path as the book said I need but I get the error:
The attribute activationConfig is undefined for the annotation type MessageDriven
I am using JBoss 5.1.0.GA, I have tried using so many jar files to see if it was that but I cannot get this working, any suggestions would be much appreciated. - Thanks, James.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4246649#4246649
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4246649
More information about the jboss-user
mailing list