cancel
Showing results for 
Search instead for 
Did you mean: 

ActivitiEngine object coming as null in standalone java class

penusila611621
Champ in-the-making
Champ in-the-making
I am newbie in activiti and below is my problem

1. Downloaded activiti 5.14 distribution
2. Downloaded eclipse plug in 5.14.1 and setup the eclipse to work with activit
3. Developed a simple process
4. Created test java class with the help of JUnit test option
5. The following statement is returning null means processEngine object is null
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();

6. Attached the java class & activit-cfg.xml file(tried with h2 properties and with out h2 db properties in xml file)
7. Commented the lines in java class to check step by step

i am not able to proceed because of NullPointer exception. All the activiti related jar's downloaded added to classpath.

I am doing a poc and prompt response is very much appreciated.
18 REPLIES 18

penusila611621
Champ in-the-making
Champ in-the-making
Please help me out

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Is your question How to write jUnit test?
If yes follow the link
http://forums.activiti.org/content/sticky-how-write-unit-test

Regards
Martin

penusila611621
Champ in-the-making
Champ in-the-making
Yeah. But I am not able to run a simple process in eclipse. Attached are the POC components.

heatherashmore
Champ in-the-making
Champ in-the-making
I am very new to activiti, i have build a simple process in process designer and trying to run the process from java class.

click through the following post

frederikherema1
Star Contributor
Star Contributor
Do you see a stacktrace in the console? Are you sure the activiti.cfg.xml is on your classpath (make sure it's actually called activiti.cfg.xml, not activiti-cfg.xml unless you use another way of instantiating the engine).

There is no activiti.cfg.xml file in my classpath by default but I created a one. How to set it on classpath

frederikherema1
Star Contributor
Star Contributor
Are you serious? Depends on your container and environment, but this is java 101. Don't think the activiti-forum is the best place to get answers on this kind of questions..

penusila611621
Champ in-the-making
Champ in-the-making
My question is whether the activiti.cfg.xml file will be creted once I create activiti project OR should I create the file separately, later add the same to classpath.

jbarrez
Star Contributor
Star Contributor
You need one activiti.cfg.xml file for each Activiti Process Engine instance you want to create.

Typically, each application has only need for one such engine and thus file. But you are free to have many more, eg activiti1.cfg.xml, activiti2.cfg.xml, etc.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.