<div dir="ltr">A test case will be required to reproduce your problem. Do you have a pax-exam test ?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 20, 2014 at 1:03 PM, Ephemeris Lappis <span dir="ltr"><<a href="mailto:ephemeris.lappis@gmail.com" target="_blank">ephemeris.lappis@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello.<br>
<br>
Here is the first lines of the error message :<br>
<br>
<br>
14:58:57,457 | ERROR | tp1946301910-151 | AbstractKieModule |<br>
239 - org.drools.compiler - 6.1.0.20140429-1643 | Unable to build<br>
KieBaseModel:MyKBase<br>
Rule Compilation error : [Rule name='Main Rule']<br>
my/tests/drools/osgi/expert/rules/Rule_Main_Rule1409557233.java (8:649) :<br>
Incorrect number of arguments for type HashMap<K,V>; it cannot be<br>
parameterized with arguments <?><br>
my/tests/drools/osgi/expert/rules/Rule_Main_Rule1409557233.java (8:666) :<br>
Syntax error on token "<", ? expected after this token<br>
<br>
<br>
I have found the explanation and a workaround : put it all with a strict<br>
"1.5" syntax in the RHS ! In this current case, do not use <> to infere the<br>
generic type, but use the expected declared types instead.<br>
<br>
After a rather touchy remote debug of the ServiceMix runtime to inspect what<br>
is different from the Junit tests, I think that the problem comes from the<br>
classloader that is associated with the Kie container. Before compilation<br>
the language source and target level is set with version 1.7 as expected,<br>
but in the nameEnvironment that is passed to the JavaCompiler (indeed, ecj<br>
compiler), the droolsClassloader is of type<br>
"org/apache/felix/framework/ModuleImpl$ModuleClassLoaderJava5". As its name<br>
seems to incidate, I'm afraid that the Karaf/Felix loader is originally<br>
built in 1.5.<br>
<br>
I've read some posts about the eclipse compiler that perhaps takes into<br>
account the caller compliance to adapt its compilation language level.<br>
<br>
Class loaders seem to be a serious problem when using Drools in complex<br>
environment such as a OSGi one...<br>
<br>
Please, could you confirm my analysis, and, if you have one, propose any<br>
better solution ? I don't know, for example, if it's possible to influence<br>
Karaf to use different levels of bundle class loaders...<br>
<br>
Thanks a lot.<br>
<br>
Regards.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Rules-compilation-error-with-OSGi-integration-6-1-0-Beta3-tp4029601p4029622.html" target="_blank">http://drools.46999.n3.nabble.com/Rules-compilation-error-with-OSGi-integration-6-1-0-Beta3-tp4029601p4029622.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Charles Moulliard</div><div>Apache Committer / Architect @RedHat</div><div>Twitter : @cmoulliard | Blog : <a href="http://cmoulliard.github.io" target="_blank"> http://cmoulliard.github.io</a></div>
<div><br></div></div>
</div>