MDB listening a Topic in JBoss 5.1

Posted by fool on Stack Overflow See other posts from Stack Overflow or by fool
Published on 2010-04-13T22:19:25Z Indexed on 2010/04/13 22:22 UTC
Read the original article Hit count: 878

Filed under:
|

Hi,

I have a topic configured correctly like this, in jboss 5.1:

 <mbean code="org.jboss.jms.server.destination.TopicService"
  name="jboss.messaging.destination:service=Topic,name=GreetingsTopic"
  xmbean-dd="xmdesc/Topic-xmbean.xml">
  <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
  </depends>
  <depends>jboss.messaging:service=PostOffice</depends>
 </mbean>

I can see the topic being started in JBoss logs:

23:08:40,990 INFO [TopicService] Topic[/topic/GreetingsTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000

And I have this MDB:

@MessageDriven(activationConfig = {
  @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jmx.Topic"),
  @ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/GreetingsTopic")
})
public class GreetingsClientWebMDB implements MessageListener {
...
...
}

When I deploy the MDB, I'm getting a strange error:

3:09:30,781 ERROR [JmsActivation] Unable to reconnect [email protected]([email protected] destination=topic/GreetingsTopic destinationType=javax.jmx.Topic tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
java.lang.ClassCastException: Object at 'topic/GreetingsTopic' in context {java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces:org.jboss.naming:org.jnp.interfaces} is not an instance of [class=javax.jms.Queue [email protected]{vfsfile:/usr/local/jboss-5.1.0.GA/server/default/conf/jboss-service.xml} interfaces={interface=javax.jms.Destination [email protected]{vfsfile:/usr/local/jboss-5.1.0.GA/server/default/conf/jboss-service.xml}}] object class is [class=org.jboss.jms.destination.JBossTopic [email protected]{vfsfile:/usr/local/jboss-5.1.0.GA/server/default/conf/jboss-service.xml} interfaces={interface=javax.jms.Topic [email protected]{vfsfile:/usr/local/jboss-5.1.0.GA/server/default/conf/jboss-service.xml}}]
 at org.jboss.util.naming.Util.checkObject(Util.java:338)
 at org.jboss.util.naming.Util.lookup(Util.java:223)
 at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupDestination(JmsActivation.java:464)
 at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:352)
 at org.jboss.resource.adapter.jms.inflow.JmsActivation.handleFailure(JmsActivation.java:292)
 at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:733)
 at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)
 at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:619)

I also try to use a deployment descriptor instead of annotations but with the same result.

I really can't see the problem :(

© Stack Overflow or respective owner

Related posts about jboss5.x

Related posts about jboss-mdb