Method PlatformAPI.startNode() must be called previously.

1
0
-1

hello, configure tomcat with mysql. BD was built correctly, but when I try to run the following example throws me the following error

try {
final LoginAPI loginAPI = TenantAPIAccessor.getLoginAPI();
APISession session = loginAPI.login("bonita", "bpm");
ProcessAPI processAPI = TenantAPIAccessor.getProcessAPI(session);
} catch (BonitaHomeNotSetException ex) {
Logger.getLogger(ControladorIndex.class.getName()).log(Level.SEVERE, null, ex);
} catch (ServerAPIException ex) {
Logger.getLogger(ControladorIndex.class.getName()).log(Level.SEVERE, null, ex);
} catch (UnknownAPITypeException ex) {
Logger.getLogger(ControladorIndex.class.getName()).log(Level.SEVERE, null, ex);
} catch (LoginException ex) {
Logger.getLogger(ControladorIndex.class.getName()).log(Level.SEVERE, null, ex);
}

Node not started. Method 'org.bonitasoft.engine.api.LoginAPI.login' cannot be called until node has been started (PlatformAPI.startNode()). Exact class: org.bonitasoft.engine.api.impl.LoginAPIImpl
2016-04-21 18:05:16.149 -0300 org.zkoss org.zkoss.zk.ui.impl.UiEngineImpl handleError:1352
GRAVE: >>org.bonitasoft.engine.platform.NodeNotStartedException: The current node has not been started yet. Method PlatformAPI.startNode() must be called previously.

at org.bonitasoft.engine.api.impl.ServerAPIImpl.checkMethodAccessibility(ServerAPIImpl.java:287)
at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIOutsideTransaction(ServerAPIImpl.java:278)

Comments

Submitted by fmelossi on Mon, 04/25/2016 - 22:56

I think I've solved the problem, place the first four lines and stop throwing error.

regards

Map<String, String> settings = new HashMap<String, String>();
settings.put("server.url", "http://localhost:8084");
settings.put("application.name", "bonita");
APITypeManager.setAPITypeAndParams(ApiAccessType.HTTP, settings);

        final LoginAPI loginAPI = TenantAPIAccessor.getLoginAPI();
        APISession session = loginAPI.login("administrator", "bpm");
        ProcessAPI processAPI = TenantAPIAccessor.getProcessAPI(session);
3 answers

1
0
-1

TenantAPIAccessor is a Singleton that needs parameters to know how to connect to your Bonita platform before any API call can be made. Full documentation is available on this page .

1
0
-1

Hello,
Could you please help me understand where exactly did you have to add the above mentioned line?

I'm running into similar issue.

Thanks

1
0
-1

I think I've solved the problem, place the first four lines and stop throwing error.

regards

Map<String, String> settings = new HashMap<String, String>();
settings.put("server.url", "http://localhost:8084");
settings.put("application.name", "bonita");
APITypeManager.setAPITypeAndParams(ApiAccessType.HTTP, settings);

    final LoginAPI loginAPI = TenantAPIAccessor.getLoginAPI();
    APISession session = loginAPI.login("administrator", "bpm");
    ProcessAPI processAPI = TenantAPIAccessor.getProcessAPI(session);
Notifications