AnsweredAssumed Answered

Using ExpressionFactory in OSGI environment: org.activiti.engine.impl.juel.ExpressionFactoryImpl not found by ...

Question asked by mebold on Apr 25, 2013
Latest reply on Jul 17, 2013 by rahulkrs
I'm using Activiti in OSGI environment and when executing a ServiceTask specified the following way I get an exception:
<serviceTask id="serviceTask" activiti:expression="#{TestBeanDelegate.doSomething()}" activiti:resultVariable="resultOfCall"/>
and the exception is:

org.activiti.engine.impl.juel.ExpressionFactoryImpl not found by ourBundle [94]
The exception comes from ExpressionFactory class while it tries to create a new instance. The reason is that in the newInstance() method it uses the Thread.currentThread().getContextClassLoader() which in this case is the classloader of the bundle that started the call. In our case that bundle does not know anything about the Activiti classes so the result is the exception.

There is a ReflectUtil class in Activiti that has all the necessary operations: but trying to load the class using the different available classloaders.

Is there any reason why you are not using that helper class here? If it's only a coincidence it would be only a few lines of change in the code to make it more flexible.

Thanks, Orsi