1 Reply Latest reply on Sep 26, 2005 10:50 AM by Damon Sicore

    Cannot write to Queue using JmsXA as a Connection Factory

    Nestor Bucosky Newbie

      I am trying to use JbossJCA. I wrote some code in which I used "JmsXA" as the connection factory. I was writing to a queue (not using MDB's) and received the following error. The error says that the destination is an invalid destination. The queue is of type org.jboss.mq.SpyQueue which extends SpyDestination

      10:42:38,984 INFO [STDOUT] javax.jms.InvalidDestinationException: Destination is not an instance of SpyDestination QUEUE.A
      10:42:38,984 INFO [STDOUT] at org.jboss.mq.SpyMessageProducer.send(SpyMessageProducer.java:225)
      10:42:38,984 INFO [STDOUT] at org.jboss.mq.SpyMessageProducer.send(SpyMessageProducer.java:199)
      10:42:38,984 INFO [STDOUT] at com.omgeo.ats.common.action.LoginAction.doExecute(LoginAction.java:95)
      10:42:39,000 INFO [STDOUT] at com.omgeo.ats.common.action.BaseAction.execute(BaseAction.java:68)
      10:42:39,000 INFO [STDOUT] at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
      10:42:39,000 INFO [STDOUT] at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
      10:42:39,000 INFO [STDOUT] at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1146)
      10:42:39,000 INFO [STDOUT] at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:410)
      10:42:39,000 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      10:42:39,015 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      10:42:39,015 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      10:42:39,015 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      10:42:39,015 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      10:42:39,015 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      10:42:39,015 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      10:42:39,015 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      10:42:39,015 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)


      Here is a snippet of my code
      InitialContext ctx_ = new InitialContext();
      ctx_.addToEnvironment(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      ctx_.addToEnvironment(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );
      ctx_.addToEnvironment(Context.PROVIDER_URL, "jnp://localhost:1099" );
      Object qcfo= ctx_.lookup( "java:/JmsXA");
      QueueConnectionFactory qcf = (QueueConnectionFactory) qcfo;
      QueueConnection con = qcf.createQueueConnection();
      QueueSession ses = con.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
      Queue queue = (Queue)ctx_.lookup("queue/A");
      QueueSender sender = ses.createSender(queue);
      TextMessage msg = ses.createTextMessage("Hello World");
      sender.send(msg);

      Any help will be greatly appreciated.