Mongodb and Tomcat Connection compared with Postgresql and Tomcat Connection

19 views
Skip to first unread message

juhi bhatia

unread,
Jan 11, 2017, 8:51:26 AM1/11/17
to mongodb-user
I am doing a PoC with a concept where I am using both Postgresql and Mongodb together with Tomcat. I run mongodb (2.4), postgresql(9.1) and tomcat(6.0.44 with Java 6) as service on ubuntu 14.04 LTS When I deploy my application with Tomcat I run certain test cases that are necessary for the PoC. One amongst them is auto start of these services on system start. 

When the system starts mongodb takes time to start up while tomcat server and postgresql start - due to this I have to manually restart tomcat server because it cannot connect to mongodb even when mongodb is already up and running.

Due to the above issue I did the following tests:

Test 1
1. Stop all services.
2. Start mongodb.
3. Start tomcat.
4. Start postgresql.
Before Step 4 I query tomcat - it gives errors.
After step 4 I query tomcat - it runs just fine.

Test 2
1. Stop all services.
2. Start postgresql.
3. Start tomcat
4. Start mongodb.
Before step 4 I query tomcat - it gives errors.
After step 4 I query tomcat - it gives errors.
I have to manually stop and then start tomcat for it to run properly.

Question: 
1. Why does mongodb not connect seamlessly with tomcat but postgresql does if it starts after tomcat starts?
2. Am I missing any configuration with mongodb?

I have attached my mongodb and postgresql configuration file.

Please help - I have found nothing on web related to this.

Juhi.



mongodb-da.xml
postgresql.xml
Reply all
Reply to author
Forward
0 new messages