cancel
Showing results for 
Search instead for 
Did you mean: 

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

mebold
Champ in-the-making
Champ in-the-making
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
4 REPLIES 4

trademak
Star Contributor
Star Contributor
Hi Orsi,

I think ReflectUtil was introduced at a later point in time and this code should have been replaced by a call to that class. Could you create a JIRA issue for this and maybe add an example that shows this error?

Thanks,

mebold
Champ in-the-making
Champ in-the-making
I've created the JIRA issue: http://jira.codehaus.org/browse/ACT-1674
It took me some time to create an example but at the end it turned out that one of the basic examples fails because of the same exception.
I've modified the ActivitiInAction book's osgi sample and used Karaf to test it, files are attached to the issue.

Orsi

trademak
Star Contributor
Star Contributor
Thanks Orsi, will take a look at your patch as soon as I can.

Best regards,

rahulkrs
Champ in-the-making
Champ in-the-making
I am using 5.12.1 and facing the same issue, is there a work around so that without even migrating to 5.13 we should be able to do the trick?