4

I run and initialize an instance using the following code:

        EmbeddableDocumentStore db = new EmbeddableDocumentStore();
        db.DataDirectory = @"C:\RavenDb\";
        db.Configuration.HostName = "localhost";
        db.Configuration.Port = 8080;
        db.UseEmbeddedHttpServer = true;
        db.Initialize();

After initializing and keeping the app in debug mode I try to access the management studio on my browser through "localhost:8080" but the request times out/ nothing happens. I tried different ports, I start VS2012 in Admin mode. I downloaded the latest versions through Nuget. What am I doing wrong/ not seeing here?

Thanks

Edit: After couple suggestions I tried the following code, still to no avail:

        NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(8080);
        EmbeddableDocumentStore db = new EmbeddableDocumentStore
        {
            RunInMemory = true,
            DataDirectory = @"C:\RavenDb\",
            UseEmbeddedHttpServer = true
        };

        db.Initialize();

In addition I received the following warning messages in the output window upon running the console application:

Resulting in: Cannot set import 'Raven.Database.Server.Security.OAuth.OAuthClientCredentialsTokenResponder.AuthenticateClient (ContractName="Raven.Database.Server.Security.OAuth.IAuthenticateClient")' on part 'Raven.Database.Server.Security.OAuth.OAuthClientCredentialsTokenResponder'. Element: Raven.Database.Server.Security.OAuth.OAuthClientCredentialsTokenResponder.AuthenticateClient (ContractName="Raven.Database.Server.Security.OAuth.IAuthenticateClient") --> Raven.Database.Server.Security.OAuth.OAuthClientCredentialsTokenResponder --> AssemblyCatalog (Assembly="Raven.Database, Version=2.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593")

Matt
  • 7,004
  • 11
  • 71
  • 117
  • Remove the hostname setting, and it should work – Ayende Rahien Jan 31 '13 at 09:13
  • @AyendeRahien, I removed it, no change, it does not work. I also tried Yogi's code snippet. No luck either. – Matt Jan 31 '13 at 09:43
  • By the way, when I run Raven.Server.exe I have no problem getting into management studio. Its causing problems when I run the embedded document store as indicated in the snipped above – Matt Jan 31 '13 at 10:00
  • I added some information from the output window upon running the client in a console application. – Matt Jan 31 '13 at 11:52

1 Answers1

4

This is one solution for the nuget pakage

<package id="RavenDB.Embedded" version="2.0.2230" targetFramework="net45" />

Make sure the port is not in use

NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(8080);
var documentStore = new EmbeddableDocumentStore
{
    RunInMemory = true,
    DataDirectory = @"C:\RavenDb\",
    UseEmbeddedHttpServer = true
};

documentStore.Initialize();
Beatles1692
  • 5,214
  • 34
  • 65
Yogi
  • 121
  • 2
  • no change, "localhost:8080" within my browser gets me nowhere. The port is not blocked. ;-( – Matt Jan 31 '13 at 09:42
  • I double checked, I run on version 2.0.2230 for all 3 installed RavenDB components – Matt Jan 31 '13 at 10:10
  • I added some warning messages I captured in the output window. – Matt Jan 31 '13 at 11:53
  • Looks like a similar issue was raised: https://groups.google.com/forum/?fromgroups=#!topic/ravendb/zJbA3fG3cAo – Yogi Jan 31 '13 at 13:15
  • well currently it looks like this renders RavenDB pretty much useless if the requirement is to run embedded. The Management Studio is currently the only way to manage the database. – Matt Jan 31 '13 at 13:18
  • RavenDB uses REST and JSON so you could use Fiddler or even cURL to access the DB. LinqPad has a driver too. – Yogi Jan 31 '13 at 13:38
  • how would that work if RavenDB does not even expose the http server? Sorry I guess I sound a bit pessimistic here, its just I was quite impressed with everything I have seen about RavenDB until I hit a brick wall. The disappointing issue is that this bug seems to have been around for more than a year and it has apparently still not been fixed. (I googled and found posts referring to similar error messages) – Matt Jan 31 '13 at 13:50
  • Have a look at the HTTP API: http://ravendb.net/docs/2.0/http-api/http-api-single and as a first step try this url in a browser (I use FireFox): http://localhost:8080/docs/ – Yogi Jan 31 '13 at 13:57
  • I think I found the problem. I have no idea why but after I initialize I set a break point in order to check whether the server was setup. I now just have the console wait through `Console.Readline()` and the server responds without problems. I have no idea why but it apparently works. – Matt Jan 31 '13 at 14:09
  • If your program is stopped on a breakpoint, then all threads are suspended, including those used by RavenDB Embedded. As such it can't respond to any requests. – Matt Craig Dec 07 '14 at 08:22