cancel
Showing results for 
Search instead for 
Did you mean: 

Classloading problem with osgi

lvolckaert
Champ in-the-making
Champ in-the-making
Hi,

I'm running Activiti in an OSGI environment, with the engine in one bundle and several other bundles provide the process definitions and related resources.

I've run into a ClassNotFoundException when reading a process variable I've set previously, because the engine bundle classloader does not know the Class of the process variable.
Which is normal because it's an implementation and I don't what to export those in my OSGI environment.

So I see a few options to get the deserialization to work but I would like some guidance.

1) Create a custom VariableType for each process variable I want to store. Can I add these dynamically to the configuration depending on the bundles that are active?

2) Forget storing serializable types and convert the object to XML or JSON first and deconvert from string process variable with my own converter.

3) Replace the classloader on the ProcessEngineConfigurationImpl each time you load a process variable so the ReflectUtil will find it.

4) Temporarily replace the classloader of the thread.

5) Other ?

I would preferably not use 3 or 4 because they seem to be cheating OSGI.

So what's the best way? Any tips or tricks?
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
Solutions one and two seem to be a good solution. I can't think of any other solutions…
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.