Question

I am trying to develop a portlet in Liferay that operates on a Bonita workflow, but I keep getting the exception in the title. I am not particularly familiar with the Java world, so I have no idea what to bang my head against :)

Was it helpful?

Solution

You probably called some code like:

new LiferayClass();

and the JVM has no idea where the class's constructor is. This often happens because you were careful to tell the compiler (javac) where the library (Liferay JAR file) was when you were compiling, but you didn't tell the JVM (java) where the library was when you attempted to run the program.

The easiest way to tell the JVM where the required libraries can be found is with a search path called CLASSPATH. Export an environmental variable that looks like this:

For Unix/Linux

CLASSPATH=/path/to/liferay.jar:/path/to/bonita.jar

For Windows

CLASSPATH=C:\path\to\liferay.jar;C:\path\to\bonita.jar

--- edit after clarification that this is a web application ---

Since this is a web application, you don't put the JAR file in the classpath. You place it in the WEB-INF/lib directory internal to the WAR file you create. That way it will only be exposed to your web application; otherwise, it could interfere with the other deployed web applications.

OTHER TIPS

You can access to Bonita engine via API Rest from anywhere.

Here documentation of Bonita REST API: http://www.bonitasoft.com/resources/documentation/bos-59/development/bonita-execution-engine/accessing-bonita-execution-engine

You can create a Liferay Portlet calling processes created with Bonita via API Rest, just follow the documentation.

Regards.

It's hard to say exactly what's wrong without more information, but it's almost bound to be a classpath issue. Find whichever class is mentioned in the exception, and make sure that the jar file containing that class is on the classpath. Without being familiar with Liferay I don't know how you'll do that, but it's probably a case of dropping the jar file into the right directory.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top