3 Replies Latest reply on Apr 26, 2010 8:06 AM by Ruchi Agrawal

    casting a JBoss Queue to user defined Queue

    Ruchi Agrawal Newbie

      Hi All ,


      I am new to using JBoss and currently m working on Jboss 5.1.0 GA . The problem is I have created a Queue AMIClientQueue on Jboss and I want to   lookup and access it in my code with the following code snippet :

      Actor actor = (Actor)ctx.lookup(operation);

      where Actor has to be an interface and being an interface it can extend the javax.jms.Queue interface but when I do so and run

      the above code I get the following exception :

      java.lang.ClassCastException:org.jboss.jms.destination.JBossQueue cannot be cast to alu.smm2.rt.core.Actor
          at alu.smm2.rt.core.InvocationRouter.proceed(InvocationRouter.java:49)
          at alu.smm2.rt.facade.TestFacadeBean.readLoadProfileHistoryAsync(TestFacadeBean.java:48)
          at alu.smm2.rt.Test.main(Test.java:44)

      which is right since extending the queue interface shouldn't logically resolve the problem.

      The problem is I can't write Actor as a abstract class therefore I can't extend JBossQueue class , other wayout could be to get rid

      of JBossQueue class and have my queue created on Jboss as javax.jms.queue , I am really not able to figure out how to do it .

      Could anybody plz help me out on this .

      Is it possible to do such change of Queue from JBOSSQueue to jmsQueue and if not then what else can I do to attain what I want to.?

      Thanks in Advance