# Method PlatformAPI.startNode() must be called previously.

**URL:** <https://community.ofelia.com/t/method-platformapi-startnode-must-be-called-previously/7241>\
**Category:** Q&A\
**Created:** [21 April 2016 21:10 UTC](https://community.ofelia.com/t/method-platformapi-startnode-must-be-called-previously/7241 "2016-04-21T21:10:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmelossi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/fmelossi/32/876_2.png) [@fmelossi](https://community.ofelia.com/u/fmelossi)\
**Post date:** [21 April 2016 21:10 UTC](https://community.ofelia.com/t/method-platformapi-startnode-must-be-called-previously/7241/1 "2016-04-21T21:10:03Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![fmelossi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/fmelossi/32/876_2.png) [@fmelossi](https://community.ofelia.com/u/fmelossi)\
**Post date:** [25 April 2016 20:58 UTC](https://community.ofelia.com/t/method-platformapi-startnode-must-be-called-previously/7241/2 "2016-04-25T20:58:28Z")

</div>

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](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);

```

---

<div class="post-metadata">

**Author:** ![isha.d.gupta\_1378267](https://avatars.discourse-cdn.com/v4/letter/i/a87d85/32.png) [@isha.d.gupta\_1378267](https://community.ofelia.com/u/isha.d.gupta_1378267)\
**Post date:** [29 October 2018 19:17 UTC](https://community.ofelia.com/t/method-platformapi-startnode-must-be-called-previously/7241/3 "2018-10-29T19:17:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [1 November 2018 17:06 UTC](https://community.ofelia.com/t/method-platformapi-startnode-must-be-called-previously/7241/4 "2018-11-01T17:06:14Z")

</div>

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](https://documentation.bonitasoft.com/bonita/7.8/create-your-first-project-with-the-engine-apis-and-maven) .

---

<div class="post-metadata">

**Author:** ![fmelossi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/fmelossi/32/876_2.png) [@fmelossi](https://community.ofelia.com/u/fmelossi)\
**Post date:** [25 April 2016 20:56 UTC](https://community.ofelia.com/t/method-platformapi-startnode-must-be-called-previously/7241/5 "2016-04-25T20:56:40Z")

</div>

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](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);

```
