Unable to start a Bloomberg session
Asked Answered
B

2

6

I'm currently trying to connect to the Bloomberg API but after trying for a day still not able to get it running.

Below is sample code from the API Guide, the part where I keep getting "Could not start session." when trying to connect.

public static void main(String[] args) throws Exception {
    SessionOptions sessionOptions = new SessionOptions();  
    sessionOptions.setServerHost("localhost"); // default value 
    sessionOptions.setServerPort(8194); // default value
    Session session = new Session(sessionOptions);
    if (!session.start()) {
        System.out.println("Could not start session.");
        System.exit(1);
    }
    if (!session.openService("//blp/refdata")) {
        System.out.println("Could not open service " +
                           "//blp/refdata");
        System.exit(1);
    }
}

I also tried the async example available in the guide, but no luck as well.

Is there anything that I missed in order to use the API? Or if I have to apply for an account in order to use the API, please do let me know :)

Burt answered 17/4, 2012 at 5:28 Comment(0)
M
5

Your program runs fine on my machine. The few things you should check:

  • Are you on a Bloomberg terminal machine? (I assume you are using the desktop version)
  • Do you have a Bloomberg session open?
  • Is the bbcom.exe process running?

Just read the last line of your question: you need to have a Bloomberg account to be able to use their API and retrieve data.

Marriott answered 17/4, 2012 at 11:10 Comment(3)
Thanks for you reply! Please spare my ignorance... - I test the code on Ubuntu 10 and OSX Lion - What is Bloomberg session? The session we open in the code? - I'm on Unix base machine, bbcom.exe seem wont be able to run on it I do have an Bloomberg account (my client does), is there a docs somewhere mention how to set it up?Burt
By session, I mean that you need to have a BB terminal open. Best thing in your case would be to call BB support, they should be able to get you started.Marriott
I think that's the only way I can take, thanks for giving advice :)Burt
C
-1

My problem was solved after running "bbcomm.exe"

Check the following: https://github.com/matthewgilbert/pdblp/issues/55

Carven answered 27/11, 2019 at 1:47 Comment(1)
A link to a solution is welcome, but please ensure your answer is useful without it: add context around the link so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. Answers that are little more than a link may be deleted.Zilla

© 2022 - 2024 — McMap. All rights reserved.