uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eddie Epstein <eaepst...@gmail.com>
Subject Re: javax.jms.JMSException: acknowledgeMode SESSION_TRANSACTED cannot be used for an non-transacted Session
Date Tue, 24 Mar 2009 21:38:27 GMT
Hi Jörn,

Unless you did an SVN update, I don't understand how it worked
and then didn't. I also don't understand how Apache Camel is
being used.

The UIMA AS client API handles all JMS interactions transparently.
A minimal application calling a UIMA AS service would look
something like this:
-------------------------------
    uimaEEEngine = new BaseUIMAAsynchronousEngine_impl();
    Map<String,Object> appCtx = new HashMap<String,Object>();
    // Add Broker URI
    appCtx.put(UimaAsynchronousEngine.ServerUri, brokerUrl);
    // Add Queue Name
    appCtx.put(UimaAsynchronousEngine.Endpoint, endpoint);
    // Add the Cas Pool Size
    appCtx.put(UimaAsynchronousEngine.CasPoolSize, casPoolSize);
    //initialize
    uimaEEEngine.initialize(appCtx);

    // Loop
    {
       // get an empty CAS
       CAS cas = uimaEEEngine.getCAS();

       // initialize CAS ...

       // call service asynchronously
       uimaEEEngine.sendCAS(cas);
     }

-------------------------------------------------------

The loop will block waiting for an empty CAS, so the cas pool
size should be at least as big as the number of service instances.

Can you give more details of the client code? Can you use
the test application driver, runRemoteAsyncAE to test the service?

Regards,
Eddie


On Tue, Mar 24, 2009 at 10:38 AM, Jörn Kottmann <kottmann@gmail.com> wrote:
> Hello,
>
> I wrote a small Apache Camel UIMA AS driver component to send
> a URI to my processing pipeline. It then uses the URI to retrieve
> the actual CAS from a hbase database and after processing is
> done the CAS is written back to hbase, like it is described in the getting
> started.
>
> I first created a small sample which worked fine for me,
> but now always this exception is thrown:
>
> javax.jms.JMSException: acknowledgeMode SESSION_TRANSACTED cannot be used
> for an non-transacted Session
>   at
> org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:300)
>   at
> org.apache.uima.adapter.jms.client.ActiveMQMessageSender.initializeProducer(ActiveMQMessageSender.java:61)
>   at
> org.apache.uima.adapter.jms.client.BaseMessageSender.run(BaseMessageSender.java:141)
>   at java.lang.Thread.run(Thread.java:619)
>
>
> In my eyes the cause for the exception is this call in ActiveMQMessageSender
> line 61: session = connection.createSession(false, 0);
>
> We try to create a transcated session (thats what 0 stands for) and set
> transacted to false,
> which is invalid usage of the API, right ? The same call can be found in the
> trunk version
> of that class.
>
> I really wonder why it worked first for me, but breaks now.
>
> Jörn
>

Mime
View raw message