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.