2

I'm trying to follow this guide but I'm stuck to the point where I have to test the MongoDB plugin. I have installed MongoDB in my system and the Mongo Plugin to IntelliJ. In the MongoDB plugin settings the "Path to Mongo Executable" is correct (it shows the success symbol when I test it).

enter image description here

But when I try to add a Mongo Server the Test Connection fails. The error is: "Timed out while waiting to connect after xxxx ms". I tried starting mongod.exe manually, restarting IntelliJ and reboot. Nothing works. What am I missing?

enter image description here

Aventinus
  • 1,322
  • 2
  • 15
  • 33

2 Answers2

2

I just downloaded it and played around with the plugin. I got it to connect only after starting up mongod manually beforehand. I don't even know if you can start up the mongod process from IntelliJ, as after reading the documentation, there is nothing about starting up the server. So basically I followed the steps you outlined, but before hitting "Test Connection", I start up the server manually. Once that is done, I was able to use the plugin's functionality.

Juan Carlos Farah
  • 3,829
  • 30
  • 42
  • It's the same. I don't understand what's wrong. I even tried downloading the 32bit version of MongoDB (I'm on Windows 8.1 64 bit). When I open mongod.exe a console window appears which closes immediately after. Is this normal? Should the console windows stay open? – Aventinus Jul 28 '14 at 16:36
  • @Aventinus_, so you were not able to run `mongod` without IntelliJ? You should be able to run `mongod` from the command line and connect to it by running `mongo`. Also, if you have Windows 64-bit, then you should run the 64-bit version of MongoDB. – Juan Carlos Farah Jul 28 '14 at 17:10
  • I am using OS X and get the same problem. I can use the command line utility (the same one I specify in 'Path to Mongo Shell' (i.e. /usr/local/bin/mongo) and connections/queries working fine. What is so odd with intelliJ plugin? – Paul Bartlett Mar 20 '17 at 18:44
0

I found the solution. The answer is given by Shivam Srivastava in this thread. The problem was that I hadn't set the dbpath. Shivam shows step by step how to achieve this.

Community
  • 1
  • 1
Aventinus
  • 1,322
  • 2
  • 15
  • 33
  • Ah, I see. So your problem seems to be that `mongod` was not starting correctly. – Juan Carlos Farah Jul 28 '14 at 17:12
  • I still have the problem, even after creating the dbpath directories and setting the dbpath... – syfantid Mar 28 '16 at 15:55
  • Hello Sofia, it's been 2 years since I made this post and I haven't used MongoDB since then, so I have no clue on how to help you. Maybe you should try your luck creating a new post. – Aventinus Mar 28 '16 at 18:44