Re: Failed to execute removeMessageHandle for handle ..

Catalin Mihalache <catam1976-/[email protected]> Mon, 7 May 2007 21:12:37 -0700 (PDT)
Newsgroups gmane.comp.java.openjms.user
Message-ID <[email protected]>
I use Open JMS 0.7.7-beta1.
Database server used to persist messages: PostgreSQL 8.2
For the moment, I fixed this problem by using non persistent messages but I really need persistent messages.

OpenJMS.xml:

<?xml version="1.0"?>

<Configuration>

  <!-- Optional. This represents the default configuration  -->
  <ServerConfiguration host="localhost" embeddedJNDI="true" />
  
  <Connectors>
    <Connector scheme="tcp">
      <ConnectionFactories>
        <QueueConnectionFactory name="MCP_QueueConnectionFactory"/>
      </ConnectionFactories>
    </Connector>
  </Connectors>

  <DatabaseConfiguration>
    <RdbmsDatabaseConfiguration
      driver="org.postgresql.Driver"
      url="jdbc:postgresql://localhost:5432/montecarlo" 
      user="blablabla" 
      password="blablabla"/>
  </DatabaseConfiguration>

  <!-- Required -->    
  <AdminConfiguration script="" />
  <LoggerConfiguration file="D:/users/catam1976/temp/mcp/openjms/log4j.xml" />  
    
  <!-- Optional. If not specified, no destinations will be created -->
  <AdministeredDestinations>
    <AdministeredQueue name="newObserversQueue" />
    <AdministeredQueue name="mailsQueue" />
    <AdministeredQueue name="dispatchNewslettersQueue" />
  </AdministeredDestinations>

</Configuration>

Message producer (for dispatchNewslettersQueue)
    /**
     * It publish a message telling that newsletters have to to dispatched
     * 
     * @param id
     * @throws NamingException
     * @throws JMSException
     */
    public void publishDispatchNewslettersMessage() {
        logger.debug("publishDispatchNewslettersMessage");

        Context jndiContext = null;
        Connection conn = null;
        Session session = null;

        try {
            jndiContext = getContext();

            conn = getQueueConnectionFactory(jndiContext).createQueueConnection();
            session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
            MessageProducer sender = session.createProducer(getDispatchNewslettersQueue(jndiContext));

            conn.start();

                         sender.send(session.createObjectMessage(MCPConstants.DISPATCH_NEWSLETTERS));

        } catch (NamingException e) {
            logger.error("", e);
            throw new RuntimeException(e);

        } catch (JMSException e) {
            logger.error("", e);
            throw new RuntimeException(e);

        } finally {
            if (conn != null) {
                try {
                    conn.close();
                } catch (JMSException e) {
                    logger.error("", e);
                    throw new RuntimeException(e);
                }
            }
            if (jndiContext != null) {
                try {
                    jndiContext.close();
                } catch (NamingException e) {
                    logger.error("", e);
                    throw new RuntimeException(e);
                }
            }
        }
    }

Message consumer:

public class DispatchNewsletterListener implements MessageListener {
    private static Logger logger = Logger.getLogger(DispatchNewsletterListener.class);

    /*
     * (non-Javadoc)
     * 
     * @see javax.jms.MessageListener#onMessage(javax.jms.Message)
     */
    public void onMessage(Message message) {
        //nothihing special
    }
}



Tim Anderson <[email protected]> wrote: What version of openjms are you running?
Can you post a sample of the code that triggers the problem?

Catalin Mihalache wrote:
> Hello,
>
> I'm quite new to OpemJMS.
> I have seen in logs of my application this ERROR message (is from 
> OpenJMS):
>
> 09:14:59.562 ERROR [Scheduler-Worker-7] - Failed to execute 
> removeMessageHandle for handle=ID:1757c9cc-c284-1004-8a7d-9a4e13b9944d 
> destination id=3 consumer id=3
>
> Please, anybody can tell me what means this error: " Failed to execute 
> removeMessageHandle for handle .. " and how to fix it ?
>
> Thank you,
>     Catalin Mihalache
>


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
openjms-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openjms-user



--

Catalin Mihalache

Sun Certified Programmer for the Java 5.0
Sun Certified Web Component Developer for J2EE 1.4
       
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
openjms-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openjms-user