3 Replies Latest reply on Jul 18, 2007 8:42 PM by j h

    JMS exception: javax.jms.IllegalStateException: Method not a

    j h Newbie

      Greetings all,

      I am using JBoss 3.2.5 to implement a JMS mail queue, I always get following exception:
      2007-07-13 10:43:49,213 INFO [STDOUT] javax.jms.IllegalStateException: Method not allowed
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.jboss.resource.adapter.jms.JmsSession.checkStrict(JmsSession.java:388)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.jboss.resource.adapter.jms.JmsMessageConsumer.setMessageListener(JmsMessageConsumer.java:111)
      2007-07-13 10:43:49,213 INFO [STDOUT] at au.gov.nsw.community.mail.MailConsumer.consume(MailConsumer.java:88)
      2007-07-13 10:43:49,213 INFO [STDOUT] at au.gov.nsw.community.forms.servlet.FormSubmitServlet.init(FormSubmitServlet.java:52)
      2007-07-13 10:43:49,213 INFO [STDOUT] at javax.servlet.GenericServlet.init(GenericServlet.java:211)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1019)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:144)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:72)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:275)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      2007-07-13 10:43:49,213 INFO [STDOUT] at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      2007-07-13 10:43:49,213 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)

      the line in the MailConsumer() code is:
      public void consume() {
      try {
      QueueConnection con = _factory.createQueueConnection();

      _session = con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      QueueReceiver subscriber = _session.createReceiver(_queue);

      /*line 88*/ subscriber.setMessageListener(this);
      System.out.println("*************** MailConsumer:start ...****************");
      con.start();
      }
      catch (Exception e) {
      e.printStackTrace();
      }
      }

      Could anybody tell me how to fix it, this code has been running correctly in JRun. I do appreciate for any help.

      Cheers,
      hj