Since Bonita 7.4 we have a avertissement while connecting to bonita in HTTP mode :
AVERTISSEMENT: You are declaring an API access to Bonita BPM Engine as a remote connection, whereas it looks like you are running in the same JVM. You should use LOCAL connection, using constant 'ApiAccessType.LOCAL'
But changing ApiAccessType.HTTP to LOCAL failed the connection :
org.bonitasoft.engine.exception.ServerAPIException: java.lang.reflect.InvocationTargetException
java.lang.IllegalStateException: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
According to the source code, the engine try to load the class ProcessAPIImpl to check whether the engine is accessible in LOCAL mode.
The check can be misleaded if you load the jar bonita-server in the classpath of your Java program. Could you check whether or not you have this Jar file present in your classpath. If so, try to remove it and see if the message went away.
I was with the same "problem". Found that the project had an unneeded (hope so) dependency with bonita-server in pom. I did took it out and no warnings anymore. Still with ApiAccessType.HTTP.
I don’t think the problem is a jar one because the connexion is going very well in HTTP mode… As the AVERTISSMENT message says : You are declaring an API access to Bonita BPM Engine as a remote connection, whereas it looks like you are running in the same JVM. You should use LOCAL connection, using constant 'ApiAccessType.LOCAL
. So my question was how to access api in local mode since I have a problem just changing the ApiAccessType value…
What I was trying to say is that in your case, the connexion between your application and the Bonita Engine will work only on HTTP mode. The Local Mode won’t work, as the class from the bonita engine and your application are in different class paths.
The message here is misleading. But it is displayed due to the fact that you load the bonita-server.jar in your class path.
I begin understanding, the API Access is not an conversation mode with API but an access mode to the API definition… And whereas the bonita jar are in the library path of my application, I can’t use the ApiAccessType.LOCAL.
Bonitasoft empowers development teams with Bonita, the open-source and extensible platform to solve the most demanding process automation use cases. The Bonita platform accelerates delivery of complex applications with clear separation between capabilities for visual programming and for coding. Bonita integrates with existing solutions, orchestrates heterogeneous systems, and provides deep visibility into processes across the organization.