1
votes

I'm trying to implement OpenNTF Domino API as a replacement in our project but it fails with this message: "OpenNTF Domino API: org.openntf.domino.utils.Factory is not initialized for this thread!"

Code snippet: boolean init = Factory.isInitialized(); // false Database db = Factory.getSession().getCurrentDatabase(); // This fails of course because no Session

I'm implementing the call in a JAVA DAO behind a EXTLib Servlet in XPages. So it's not called by an XPage but as an REST API call.

The Domino API Demo DB is working so the server install seems to be OK.

Is there a setup, properties I'm missing to init it ?

1

1 Answers

2
votes

Yes, there is specific setup require for non-XPages access, as done in OsgiWorlds on OpenNTF. Nathan has added a DAS extension specifically for REST access from Graph database. You basically need to initialise the session for the Factory before trying to access it, generally done in the Servlet when it initiates the HTTP connection. Please contact me on Twitter (Paulswithers) so the team can work with you. Also it's worth you having a look at the OsgiWorlds source code. Although that's for a Vaadin servlet and allows defining a development user to run as, in production mode it also uses the logged on user name and the configuration class and calls to it from the servlet are effectively what you need from the REST servlet.