cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti 5.12 ClassNotFoundException for log4j in Eclipse

sistemasmunicip
Champ in-the-making
Champ in-the-making
Hello, I'd like some help regarding an Exception thrown when instantiating the engine in Activiti 5.12 . Recently I updated from version 5.10 to 5.12, I'm working with Eclipse on a GXT (Sencha Ext Gwt) project. Before the update (that consisted simply in changing the Activiti libraries) the project had no errors. But after changing the libraries I started to get exceptions regarding slf4j and log4j class not found. Now, before posting here I checked all the obvious and not so obvious possible causes, and searched on the web but obviously I am missing something…
The exception is:

Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.<clinit>(ProcessEngineConfigurationImpl.java:212)

I included in classpath all the jars that come with Activiti, plus downloaded slf4j-1.7.5 and included some jars (I think not all of them are nedded, even  there are some jars that can't be included together) but still getting the same error.

Anyone know the exactly needed jars, or had the same problem, or can give me a hint? Any help will be appreciated.
Thanks in advance
Esteban
7 REPLIES 7

frederikherema1
Star Contributor
Star Contributor
The slf4j-api-1.7.2 is a dependency of the engine in 5.12. Make sure you have that one in the library + a provider (see http://activiti.org/userguide/index.html#loggingConfiguration)

sistemasmunicip
Champ in-the-making
Champ in-the-making
Frederik, thanks for answering. I have slf4j-api-1.7.5.jar in my project classpath (I create User libraries in Eclipse) Is it ok or it should be 1.7.2 ? I'm not getting version errors at any point.
Thanks
Esteban

trademak
Star Contributor
Star Contributor
We use 1.7.2, but I guess 1.7.5 should also be fine. Can you look if the class is there?
Is it working now?

Best regards,

sistemasmunicip
Champ in-the-making
Champ in-the-making
Tijs: thanks for answering. The class is present in slf4j-api-1.7.5.jar  - in fact, testing in another (non GXT) plain Java project it works, with the same libraries. I am working on finding out if I have a conflicting library somewhere in my GXT project (it's quite big).
Any ideas will be welcome, and I'll let you know any news.
Thanks
Esteban

sistemasmunicip
Champ in-the-making
Champ in-the-making
Update: managed to make it work by copying slf4j-api-1.7.5.jar to my project's WEB-INF/lib directory. So now it runs in hosted mode as a GXT project in eclipse. I don't know if it's the ideal solution but it works  Smiley Wink

gordonko
Champ in-the-making
Champ in-the-making
I am implementing standalone Java program with activiti-engine. Anyone know where is the corresponding log4j.properties file?