cancel
Showing results for 
Search instead for 
Did you mean: 

OSGi EL resolution cannot find methods and/or properties

tomas_surovec
Champ in-the-making
Champ in-the-making
Hi,

the setup is this: I have a project A with predefined classes for data and project B with processes that uses data types from A, among others as variable types in process. I discovered an issue with evaluating EL when running an Activiti process in an OSGi environment. As long as unit testing is used, everything works just fine and all expressions are evaluated without problems. But when I deploy both A and B into OSGi, process execution fails on EL evaluation with MethodNotFoundException (or PropertyNotFoundException) like: "Cannot find method 'YYY' in 'class XXX'". Altough apparently the bundle for A exports the appropriate package correctly (I can work with class XXX in bundle B without problems), somehow the EL resolver in Activiti manages to find the class type (or it appears so), but cannot find its methods.

Details:
OSGi: Apache Karaf 2.3.1
Activiti: 5.12.1

If needed, I can prepare a demo project.
6 REPLIES 6

trademak
Star Contributor
Star Contributor
Could you try with 5.13, because we have made some improvements for this in 5.13. If the error also occurs in 5.13 can you add some more information about the XML configs you are using?

Best regards,

tomas_surovec
Champ in-the-making
Champ in-the-making
Tried it with 5.13, now it says

PropertyNotFoundException: Could not find property 0 in class java.util.ArrayList

upon evaluating JUEL expression

${myArray[0] != null}

again, the problem is just in OSGi environment. I will create a demo tomorrow and post it here.

jbarrez
Star Contributor
Star Contributor
okay - that would help us to get the problem solved quickly

tomas_surovec
Champ in-the-making
Champ in-the-making
Ok, I just narrowed it down: the problem arises in OSGi environment when evaluating a JUEL expression containing a result from Drools.

I prepared a demo (a zip archive), which:
1) contains a simple process w/ Drools business rule task and then an exclusive gateway that branches depending on the BR result
2) simple unit tests demonstrating that outside OSGi evaluation works
3) karaf command "dotj:run-process" that runs the process w/ same input as the unit tests, resulting in forementioned error

frederikherema1
Star Contributor
Star Contributor
I'm suspecting not all "regular" ELResolvers are being used (the ones responsible for resolving array-indexes instead of using them as property-names). I'll take a look at your project…

frederikherema1
Star Contributor
Star Contributor
Is it possible to include the full exception stack trace, So I know the actual root?