<div dir="ltr">I can reproduce your error when I deploy the project (compiled with 1.7) and running with JDK 1.7 on Karaf 2.2.1/Felix 3.2.2 (= SMX 4.5.3)<div><br></div><div><div>2014-05-21 13:30:25,020 | INFO  | l Console Thread | ClasspathKieProject              | 211 - org.drools.compiler - 6.0.3.redhat-1 | Found kmodule: bundle://214.4:1/META-INF/kmodule.xml</div>
<div>2014-05-21 13:30:25,024 | DEBUG | l Console Thread | ClasspathKieProject              | 211 - org.drools.compiler - 6.0.3.redhat-1 | Discovered classpath module org.drools.example:simple:1.0.0-SNAPSHOT</div><div>2014-05-21 13:30:25,024 | INFO  | l Console Thread | KieRepositoryImpl                | 211 - org.drools.compiler - 6.0.3.redhat-1 | KieModule was added:org.drools.osgi.compiler.OsgiKieModule@501d0b5a</div>
<div>2014-05-21 13:30:25,044 | ERROR | l Console Thread | AbstractKieModule                | 211 - org.drools.compiler - 6.0.3.redhat-1 | Unable to build KieBaseModel:sampleKBase</div><div>Rule Compilation error : [Rule name=&#39;CanDrink&#39;]</div>
<div><span class="" style="white-space:pre">        </span>org/drools/example/drink/Rule_CanDrink1955060708.java (8:541) : ArrayList cannot be resolved to a type</div><div><span class="" style="white-space:pre">        </span>org/drools/example/drink/Rule_CanDrink1955060708.java (8:550) : Syntax error on token &quot;&lt;&quot;, ? expected after this token</div>
</div><div><br></div><div>BTW you have a workaround which is to define your code like this </div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">List&lt;String&gt; l = new ArrayList&lt;String&gt;();</span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">Is it because the server runs with JDK 5 in production that you cannot change the code of the rules ?</span></div>
<div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">As ServiceMix is just a packaging of Karaf + Camel + Cxf + ActiveMQ, why don&#39;t you use directly Karaf and a more recent version of Felix (4.x) ?</span></div>
<div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></span></div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, May 21, 2014 at 12:55 PM, Ephemeris Lappis <span dir="ltr">&lt;<a href="mailto:ephemeris.lappis@gmail.com" target="_blank">ephemeris.lappis@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>Hello.</div><div><br></div><div>I could try to test on ServiceMix 5 that embeds Karaf  2.3.4, but for my concrete project, the customer current platform uses a ServiceMix 4.5.3 which is not really possible to change today while many other modules are already deployed.</div>

<div><br></div><div>Did you try in your environment the test project that I attached yesterday ? There is a rule in the project with an &quot;accumulate&quot; that generates java code that is not compiled because of missing indirect dependancy despite of the Import-Package that I&#39;ve copied from your examples. Hence my idea of a &quot;proxy&quot; classloader between Drools and its compiler and the classloader provided by the application bundle, and avoid the dynamic import that breaks the good practices...</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-21 11:48 GMT+02:00 Charles Moulliard <span dir="ltr">&lt;<a href="mailto:ch007m@gmail.com" target="_blank">ch007m@gmail.com</a>&gt;</span>:<div><div class="h5">
<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">If you look to my example posted previously there are no issues. Can you make a test using just Apache Karaf 2.3.x with Drools 6.1.0.Beta3 and tell me what happen. Which JDK do you sue ?</div><div class="gmail_extra">


<br><br><div class="gmail_quote">On Wed, May 21, 2014 at 9:03 AM, Ephemeris Lappis <span dir="ltr">&lt;<a href="mailto:ephemeris.lappis@gmail.com" target="_blank">ephemeris.lappis@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Hello.<br>
<br>
Although without much conviction, I&#39;ve tried the<br>
&quot;Bundle-RequiredExecutionEnvironment: J2SE-1.7&quot;, but it doesn&#39;t change the<br>
compilation level of the rules...<br>
<br>
As I said in a previous answer, I don&#39;t know exactly how to do it, but I<br>
think the solution may be in the way that Drools takes the classloader<br>
passed by the application to have access to specific classes like the<br>
usually imported beans used in the rules. Indeed, perhaps that instead of<br>
using directly this classloader, for its tasks, among of them the rules<br>
compilation, it should be possible to use some kind of enriched classloader<br>
that carries all the Drools needed packages, and delegates application<br>
classes resolution to the application&#39;s one.<br>
<br>
What do you think of that ?<br>
<br>
Regards.<br>
<br>
<br><span><font color="#888888">
<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-tp4029601p4029635.html" target="_blank">http://drools.46999.n3.nabble.com/Rules-compilation-error-with-OSGi-integration-6-1-0-Beta3-tp4029601p4029635.html</a><br>



<div><div>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" target="_blank">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></font></span></blockquote></div><span><font color="#888888"><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>
</font></span></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div></div></div><br></div>
<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></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>