Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6767599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:58:12+00:00 2026-05-26T14:58:12+00:00

I have two queues on my application (Spring3-Hibernate-ActiveMq). Thanks for your comments in advance.

  • 0

I have two queues on my application (Spring3-Hibernate-ActiveMq). Thanks for your comments in advance. I would be glad if you help me avoid the following error:

10:02:41,541 INFO KahaStore:463 – Kaha Store using data directory \tmp\kahadb
10:02:41,542 INFO KahaPersistenceAdapter:185 – Store is locked… waiting 10 seconds for the Store to be unlocked.
10:02:51,542 INFO KahaStore:463 – Kaha Store using data directory \tmp\kahadb
10:02:51,543 INFO KahaPersistenceAdapter:185 – Store is locked… waiting 10 seconds for the Store to be unlocked.
10:03:01,543 INFO KahaStore:463 – Kaha Store using data directory \tmp\kahadb
..
.

And Here is my applicationContext.xml

<amq:connectionFactory id="amqConnectionFactory"
    brokerURL="vm://localhost" />

<bean id="connectionFactory"
    class="org.springframework.jms.connection.CachingConnectionFactory">
    <constructor-arg ref="amqConnectionFactory" />  
    <property name="sessionCacheSize" value="100" />
</bean>

<bean id="jmsTemplateForProduct" class="org.springframework.jms.core.JmsTemplate"
    p:defaultDestinationName="Click.Queue.Product">
    <constructor-arg ref="connectionFactory" /> 
</bean>

<bean id="jmsTemplateForPayment" class="org.springframework.jms.core.JmsTemplate"
    p:defaultDestinationName="Click.Queue.Payment">
    <constructor-arg ref="connectionFactory" /> 
</bean>

<jms:listener-container concurrency="10">
    <jms:listener id="ProductListener" destination="Click.Queue.Product"
        ref="productListener" />
</jms:listener-container>

<jms:listener-container concurrency="10">
    <jms:listener id="PaymentListener" destination="Click.Queue.Payment"
        ref="paymentListener" />
</jms:listener-container>
<!-- ActiveMQ ends -->
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:58:12+00:00Added an answer on May 26, 2026 at 2:58 pm

    Well, I have solved the problem by myself. BTW thanks jkysam for your comments.

    The problem was occured because of loading of applicationContext more than once. So, anytime applicationContext is loaded, a new instance of kaha db is created and it results to locking.

    What I did is that I seperated jms related configuration from applicationContext. So, I created a new context xml file called jmsContext.xml, and move the jms (and activemq as well) related configuration lines to that file. Then in my test classes, I loaded different context xml’s depend on whether it is a jmsTest or not.

    For instance; I have two GenericUnitTest class in order to seperate context configuration. First is:

    @RunWith(SpringJUnit4ClassRunner.class)
    @ContextConfiguration(locations = {"/jmsContext.xml"})
    public abstract class GenericJmsUnitTest {  
    }   
    

    Second one is:

    @RunWith(SpringJUnit4ClassRunner.class)
    @ContextConfiguration(locations = {"/applicationContext.xml"})
    public abstract class GenericUnitTest { 
    }   
    

    And then I extend these classes depend on the test case. Here is the example;

    public class ProductQueueTest extends GenericJmsUnitTest{  
    @Autowired
    private ProductQueueService productQueueService;
    
    @Test
        public void productTest() {   
         productQueueService.sendProduct(); 
        }
    }
    

    The non-jms test class sample is:

    public class SchedularTest extends GenericUnitTest {
        @Autowired
        private Processor schedulerProcessor;
    
        @Test
         public void scheduleForProduct() {
            schedulerProcessor.processForProducts();
        }
    }
    

    BTW, I exclude component scan filters which are about queue in applicationContext.xml, And include them in jmsContext.xml. Here is the example;

    applicationContext xml is below

    <context:component-scan base-package="com.project">
      <context:exclude-filter type="regex" expression="com.project.queue.*"/>
      <context:exclude-filter type="regex" expression="com.project.test.queue.*"/>
    </context:component-scan>
    

    jmsContext xml is below

     <context:component-scan base-package="com.project.queue"/>
     <context:component-scan base-package="com.project.test.queue"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
I have an application that reads from large amount of MSMQ queues(about 10000 at
I have an application (C++) that I think would be well served by an
We have an ASP.NET application that queues some of its long-running operations (generating reports,
I have two identical servers. Both Win2k3. I have a web service that queues
We have two TFS build servers (build controllers) available for our application. Builds are
Say I have a multithreaded application made up of two separate threads and a
I have a clustered application, same application on two different servers, behind a load
In a small ASP.NET 2.0 web-application, I have two ASHX handlers (one sync, one
I have a server and client application, using IPC queues. The server is (for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.