cancel
Showing results for 
Search instead for 
Did you mean: 

activiti-webapp-rest / deployment / NullPointerException

hlux
Champ in-the-making
Champ in-the-making
hello,

To get more familiar with activiti I downloaded the sources of activiti 5.4.
As a starting point I chose to use the activiti-webapp-rest.

My Idea was to get the default installation running and make some changes then.
I started the webapp from inside Eclipse using tomcat 6.0.32.

When I enter the url http://localhost:8080/webapp-rest/
it shows the index.jsp correctly.

Entering http://localhost:8080/webapp-rest/service/index
I'm asked for username and password. I'm using kermit,kermit.

doAuthenticate (ActivitiBasicHttpAuthenticatorFactory) is called
 
public boolean doAuthenticate(String username, String password) {
    return ProcessEngines.getProcessEngine(config.getEngine()).getIdentityService().checkPassword(username, password);
  }

config.getEngine() returns "default"



public static ProcessEngine getProcessEngine(String processEngineName) {
    if (!isInitialized) {
      init();
    }
    return processEngines.get(processEngineName);
  }

this call returns null, because there is no ProcessEngine registered by the name "default".



I wouldn't be surprised if I got something wrong here.
I'd appreciate your help on this.

If anybody can recommend a better way to get used to activiti, in order to successfully set up
and integrate a bpm suite, I'd be happy to hear about it.

greetings
hlux
5 REPLIES 5

joachimvda
Champ in-the-making
Champ in-the-making
I think you have to add a activit.cfg.xml file to make this work. That is normally done automatically by the installer.

Joachim

frederikherema1
Star Contributor
Star Contributor
Jup, Joachim is right. You should add a configuration file to your webapp's classpath, just the way the demo-setup does it.

hlux
Champ in-the-making
Champ in-the-making
Thank you for your replies.

Adding the activiti.cfg.xml to the classpath was what I had to do.

I'm not sure what I was thinking.
For some reason I was convinced that the  activiti-webapp-rest was initialising a
ProcessEngine via the Config class in the spring-context.

So how does the activiti-webapp-rest get the ProcessEngine in the demo setup?
All I found in the build.xml was, that the activiti.cfg.xml is copied to the activiti-engine-examples.

I'm afraid that I'm still missing a huge bit of the overall concept.

greetings

frederikherema1
Star Contributor
Star Contributor
There is a jar-file copied (activiti.cfg.xml) with activiti.cfg.xml in it in web-inf/lib in rest-webapp. When rest-webapp is initialized, all process-engine config files on classpath are initialized.

hlux
Champ in-the-making
Champ in-the-making
Thanks again, that explains it Smiley Happy