Troubles while trying to get a standalone engine working

1
0
-1

Hey,

First of all, and I apologize if my question is dumb, but I have to admit that I am just a begginer in Java. Though, I don't see what I could have done wrong, as I have just copy/pasted what's given here : Create your first project with the Engine APIs and Maven

What I was trying to do was to create a very simple standalone engine, to see what I could do with it.

So, I have set up my Maven project, changed the pom.xml, but I'm trying to log in, the program stops, telling I might have used an unknown class (or so it's what I get). I've tried to change the line APISession session = loginAPI.login(userName, password); by APISession session = loginAPI.login("walter.bates", "bpm"); but it's not working, nor it is when I added throws declaration...

Here's the code I have :
package BonitaTest.BonitaTest;

import java.util.HashMap;
import java.util.Map;

import org.bonitasoft.engine.api.ApiAccessType;
import org.bonitasoft.engine.api.LoginAPI;
import org.bonitasoft.engine.api.ProcessAPI;
import org.bonitasoft.engine.api.TenantAPIAccessor;
import org.bonitasoft.engine.exception.BonitaHomeNotSetException;
import org.bonitasoft.engine.exception.ServerAPIException;
import org.bonitasoft.engine.exception.UnknownAPITypeException;
import org.bonitasoft.engine.platform.LoginException;
import org.bonitasoft.engine.platform.UnknownUserException;
import org.bonitasoft.engine.session.APISession;
import org.bonitasoft.engine.util.APITypeManager;

public class App {

public static void main(String[] args) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException, UnknownUserException, LoginException {
System.setProperty("bonita.home", "pathtobonitahome"); //I changed it just for the c/p
Map<String, String> settings = new HashMap<String, String>();
settings.put("server.url", "http://localhost:8080");
settings.put("application.name", "bonita");
APITypeManager.setAPITypeAndParams(ApiAccessType.LOCAL, settings);
LoginAPI loginAPI = TenantAPIAccessor.getLoginAPI();
APISession session = loginAPI.login("walter.bates", "bpm");
ProcessAPI processAPI = TenantAPIAccessor.getProcessAPI(session);
}

}

And here's the log I get :

java.lang.ClassNotFoundException: org.bonitasoft.engine.api.impl.ServerAPIFactory
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.bonitasoft.engine.api.impl.LocalServerAPIFactory.<clinit>(LocalServerAPIFactory.java:34)
at org.bonitasoft.engine.api.TenantAPIAccessor.getServerAPI(TenantAPIAccessor.java:53)
at org.bonitasoft.engine.api.TenantAPIAccessor.getAPI(TenantAPIAccessor.java:97)
at org.bonitasoft.engine.api.TenantAPIAccessor.getLoginAPI(TenantAPIAccessor.java:103)
at BonitaTest.BonitaTest.App.main(App.java:26)
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.bonitasoft.engine.api.impl.LocalServerAPIFactory.<clinit>(LocalServerAPIFactory.java:37)
at org.bonitasoft.engine.api.TenantAPIAccessor.getServerAPI(TenantAPIAccessor.java:53)
at org.bonitasoft.engine.api.TenantAPIAccessor.getAPI(TenantAPIAccessor.java:97)
at org.bonitasoft.engine.api.TenantAPIAccessor.getLoginAPI(TenantAPIAccessor.java:103)
at BonitaTest.BonitaTest.App.main(App.java:26)
Caused by: java.lang.ClassNotFoundException: org.bonitasoft.engine.api.impl.ServerAPIFactory
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.bonitasoft.engine.api.impl.LocalServerAPIFactory.<clinit>(LocalServerAPIFactory.java:34)
... 4 more

Anyway, thanks in advance,

Hadrien

1 answer

1
0
-1

dude this place is some sort of Desert , no one is going to answer to this question .
for record , i have same problem and after 938 reads no one answer to this question.

Notifications