The Java code in the archive just compiles a .drl file, and there&#39;s no reason this should fail. The class cast would only appear to be missing after a Map object is inserted into WM, and the session is run so that the rule fires.<br>
-W<br><br><div class="gmail_quote">2009/10/2 Vladimir Perlov <span dir="ltr">&lt;<a href="mailto:vladperl@hotmail.com">vladperl@hotmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div>
It&#39;s compiled and working on Windows without any casting :)<br>Check out the test project I attached. <br>You will see that the rule  will compile  from web application (Windows only) or with Java SE application. The  web application using JSF so in case to run it use application server with included JSF library.<br>
<br><a href="http://download.java.net/glassfish/v3/promoted/" target="_blank">http://download.java.net/glassfish/v3/promoted/</a><br><br><br><hr>Date: Fri, 2 Oct 2009 19:48:17 +0200<div><div></div><div class="h5"><br>From: <a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a><br>
To: <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>Subject: Re: [rules-users] unable to resolve method using strict-mode<br><br>Map() in the .drl file is bound to be interpreted as Map&lt;Object,Object&gt; so that a Map.get() returns an Object. To be able to call method getSomeMethod() you&#39;d have to cast this result, according to<br>
<br> ((SomeClass)$map.get(&quot;x&quot;)).getSomeMethod()<br>
<br>I fail to understand how this could ever be avoided - strict or no strict, MVEL or not MVEL.<br><br>-W <br><br><div>2009/10/2 Vladimir Perlov <span dir="ltr">&lt;<a href="mailto:vladperl@hotmail.com" target="_blank">vladperl@hotmail.com</a>&gt;</span><br>

<blockquote style="padding-left: 1ex;">



<div>
Hi Wolfgang,<br>Thank you very much for quick response!<br><br>I tried your suggestion and still getting the following error:<br><br><h3>Unable to build expression for &#39;consequence&#39;: Failed to compile: 1
compilation error(s): - (1,29) unable to resolve method using
strict-mode: java.lang.Object.getSomeMethod() &#39;
System.out.println($map.get(&quot;x&quot;).getSomeMethod());
&#39; : [Rule name=&#39;TEST&#39;]
</h3>At least now I have only 1 compilation error comparing to the previous variant.<br><br>modified rule:<br><font face="Courier New"><br></font><font face="Courier New">rule &quot;TEST&quot;</font><font face="Courier New"><br>

</font><font face="Courier New">    dialect &quot;mvel&quot;</font><font face="Courier New"><br></font><font face="Courier New">    when</font><font face="Courier New"><br></font><font face="Courier New">            $map : Map()</font><font face="Courier New"><br>

</font><font face="Courier New">    then</font><font face="Courier New"><br></font><font face="Courier New">            System.out.println($map.get(&quot;x&quot;).getSomeMethod());</font><font face="Courier New"><br></font><font face="Courier New">end</font><br>

<br>I believe that problem is related to strict-mode that somehow enforced on Linux but not on Windows.<br>I tried to remove the strict mode using the the following approach but it seems don&#39;t have any effect.<br>We have web application with many drools rules and it&#39;s working on Windows but when we deployed the same application to   Linux we are getting failed compile errors ;) <br>

<br><font face="Courier New">KnowledgeBuilderConfiguration config = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();     </font><font face="Courier New"><br></font><font face="Courier New">config.setProperty(&quot;drools.dialect.mvel.strict&quot;, &quot;false&quot;);</font><font face="Courier New"><br>

</font><font face="Courier New">kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(config);</font><br><br>Please advise me.<br><br>By the way I&#39;m using drools 5.0.1<br><br><br><hr>Date: Fri, 2 Oct 2009 18:30:25 +0200<br>

From: <a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a><br>To: <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>Subject: Re: [rules-users] unable to resolve method using strict-mode<br>

<br>2009/10/2 Vladimir Perlov <span dir="ltr">&lt;<a href="mailto:vladperl@hotmail.com" target="_blank">vladperl@hotmail.com</a>&gt;</span><br><div><blockquote style="padding-left: 1ex;">




<div>
<br><br>Here is the rule that failed to compile on Linux:<br><br>rule &quot;TEST&quot;<br>    dialect &quot;mvel&quot;<a title="Send (Ctrl+Enter)">
    <span>Send</span></a><br>    when<br>            map : Map()<br></div></blockquote><div><br>$map : Map()<br><br>or omit &#39;$&#39; in the consequence.<br>-W<br> </div><blockquote style="padding-left: 1ex;">
<div>    then<br>            System.out.println($map.get(&quot;x&quot;).getSomeMethod());<br>end<br><br></div></blockquote></div><br>                                               <br><hr>Lauren found her dream laptop. <a href="http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290" target="_blank">Find the PC that’s right for you.</a></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>
<br></blockquote></div><br>                                               <br></div></div><div class="hm"><hr>Hotmail® has ever-growing storage! Don’t worry about storage limits. <a href="http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009" target="_blank">Check it out.</a></div>
</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>
<br></blockquote></div><br>