<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
try this:<a title="Send (Ctrl+Enter)" href="javascript:;" id="SendMessage"><span class="Label"></span></a><br><br>System.setProperty("drools.dialect.mvel.strict", "false");<br><br>it works for me :)<br><br>&gt; Date: Mon, 5 Oct 2009 00:08:48 -0700<br>&gt; From: cdelgado70@gmail.com<br>&gt; To: rules-users@lists.jboss.org<br>&gt; Subject: Re: [rules-users] unable to resolve method using strict-mode<br>&gt; <br>&gt; <br>&gt; Hi all,<br>&gt; <br>&gt; I am getting the same problem reported by vladperl. I've got rules and<br>&gt; rulesflows using MVEL2 scripts that work fine in Windows running in JBoss<br>&gt; and junit tests. I've inserted a map into StatefulKnowledgeSession and I am<br>&gt; successfully invoking myMap.myObject.myValue without any casting. However I<br>&gt; am now deploying the application in RedHat with Websphere 7 and I am getting<br>&gt; everywhere errors like:<br>&gt; unqualified type in strict mode for: myObject<br>&gt; unqualified type in strict mode for: myValue<br>&gt; unable to resolve method using strict-mode:<br>&gt; java.lang.Object.get(java.lang.String)]<br>&gt; <br>&gt; It seems that somehow the MVEL's Strong Typing Mode has been setup in this<br>&gt; env. This doesn't make sense to me. I rather prefer to believe the error is<br>&gt; misleading and something else is bothering MVEL when parsing my rules and<br>&gt; ruleflow files.<br>&gt; <br>&gt; Any help will be much appreciated!<br>&gt; <br>&gt; <br>&gt; <br>&gt; vladperl wrote:<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; Hi Wolfgang,<br>&gt; &gt; Please take a look at attached new example.<br>&gt; &gt; This time the example can demonstrate when strict mode is false we don't<br>&gt; &gt; have to put class cast.<br>&gt; &gt; Beside I finally figured out how to switch strict mode for MVEL dialect.<br>&gt; &gt; <br>&gt; &gt; Best regards,<br>&gt; &gt; Vladimir<br>&gt; &gt; <br>&gt; &gt; Date: Sat, 3 Oct 2009 14:36:10 +0200<br>&gt; &gt; From: wolfgang.laun@gmail.com<br>&gt; &gt; To: rules-users@lists.jboss.org<br>&gt; &gt; Subject: Re: [rules-users] unable to resolve method using strict-mode<br>&gt; &gt; <br>&gt; &gt; The Java code in the archive just compiles a .drl file, and there's no<br>&gt; &gt; reason this should fail. The class cast would only appear to be missing<br>&gt; &gt; after a Map object is inserted into WM, and the session is run so that the<br>&gt; &gt; rule fires.<br>&gt; &gt; <br>&gt; &gt; -W<br>&gt; &gt; <br>&gt; &gt; 2009/10/2 Vladimir Perlov &lt;vladperl@hotmail.com&gt;<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; It's compiled and working on Windows without any casting :)<br>&gt; &gt; Check out the test project I attached. <br>&gt; &gt; You will see that the rule  will compile  from web application (Windows<br>&gt; &gt; only) or with Java SE application. The  web application using JSF so in<br>&gt; &gt; case to run it use application server with included JSF library.<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; http://download.java.net/glassfish/v3/promoted/<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; Date: Fri, 2 Oct 2009 19:48:17 +0200<br>&gt; &gt; From: wolfgang.laun@gmail.com<br>&gt; &gt; <br>&gt; &gt; To: rules-users@lists.jboss.org<br>&gt; &gt; Subject: Re: [rules-users] unable to resolve method using strict-mode<br>&gt; &gt; <br>&gt; &gt; Map() in the .drl file is bound to be interpreted as Map&lt;Object,Object&gt; so<br>&gt; &gt; that a Map.get() returns an Object. To be able to call method<br>&gt; &gt; getSomeMethod() you'd have to cast this result, according to<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt;  ((SomeClass)$map.get("x")).getSomeMethod()<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; I fail to understand how this could ever be avoided - strict or no strict,<br>&gt; &gt; MVEL or not MVEL.<br>&gt; &gt; <br>&gt; &gt; -W <br>&gt; &gt; <br>&gt; &gt; 2009/10/2 Vladimir Perlov &lt;vladperl@hotmail.com&gt;<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; Hi Wolfgang,<br>&gt; &gt; Thank you very much for quick response!<br>&gt; &gt; <br>&gt; &gt; I tried your suggestion and still getting the following error:<br>&gt; &gt; <br>&gt; &gt; Unable to build expression for 'consequence': Failed to compile: 1<br>&gt; &gt; compilation error(s): - (1,29) unable to resolve method using<br>&gt; &gt; strict-mode: java.lang.Object.getSomeMethod() '<br>&gt; &gt; System.out.println($map.get("x").getSomeMethod());<br>&gt; &gt; ' : [Rule name='TEST']<br>&gt; &gt; At least now I have only 1 compilation error comparing to the previous<br>&gt; &gt; variant.<br>&gt; &gt; <br>&gt; &gt; modified rule:<br>&gt; &gt; <br>&gt; &gt; rule "TEST"<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt;     dialect "mvel"<br>&gt; &gt;     when<br>&gt; &gt;             $map : Map()<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt;     then<br>&gt; &gt;             System.out.println($map.get("x").getSomeMethod());<br>&gt; &gt; end<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; I believe that problem is related to strict-mode that somehow enforced on<br>&gt; &gt; Linux but not on Windows.<br>&gt; &gt; I tried to remove the strict mode using the the following approach but it<br>&gt; &gt; seems don't have any effect.<br>&gt; &gt; We have web application with many drools rules and it's working on Windows<br>&gt; &gt; but when we deployed the same application to   Linux we are getting failed<br>&gt; &gt; compile errors ;) <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; KnowledgeBuilderConfiguration config =<br>&gt; &gt; KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration();     <br>&gt; &gt; config.setProperty("drools.dialect.mvel.strict", "false");<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(config);<br>&gt; &gt; <br>&gt; &gt; Please advise me.<br>&gt; &gt; <br>&gt; &gt; By the way I'm using drools 5.0.1<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; Date: Fri, 2 Oct 2009 18:30:25 +0200<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; From: wolfgang.laun@gmail.com<br>&gt; &gt; To: rules-users@lists.jboss.org<br>&gt; &gt; Subject: Re: [rules-users] unable to resolve method using strict-mode<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; 2009/10/2 Vladimir Perlov &lt;vladperl@hotmail.com&gt;<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; Here is the rule that failed to compile on Linux:<br>&gt; &gt; <br>&gt; &gt; rule "TEST"<br>&gt; &gt;     dialect "mvel"<br>&gt; &gt;     Send<br>&gt; &gt;     when<br>&gt; &gt;             map : Map()<br>&gt; &gt; <br>&gt; &gt; $map : Map()<br>&gt; &gt; <br>&gt; &gt; or omit '$' in the consequence.<br>&gt; &gt; -W<br>&gt; &gt;  <br>&gt; &gt;     then<br>&gt; &gt;             System.out.println($map.get("x").getSomeMethod());<br>&gt; &gt; end<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt;                                                <br>&gt; &gt; Lauren found her dream laptop. Find the PC that’s right for you.<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; _______________________________________________<br>&gt; &gt; <br>&gt; &gt; rules-users mailing list<br>&gt; &gt; <br>&gt; &gt; rules-users@lists.jboss.org<br>&gt; &gt; <br>&gt; &gt; https://lists.jboss.org/mailman/listinfo/rules-users<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt;                                                <br>&gt; &gt; Hotmail® has ever-growing storage! Don’t worry about storage limits. Check<br>&gt; &gt; it out.<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; _______________________________________________<br>&gt; &gt; <br>&gt; &gt; rules-users mailing list<br>&gt; &gt; <br>&gt; &gt; rules-users@lists.jboss.org<br>&gt; &gt; <br>&gt; &gt; https://lists.jboss.org/mailman/listinfo/rules-users<br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt;                                                <br>&gt; &gt; _________________________________________________________________<br>&gt; &gt; Hotmail: Trusted email with Microsoft’s powerful SPAM protection.<br>&gt; &gt; http://clk.atdmt.com/GBL/go/177141664/direct/01/<br>&gt; &gt;  <br>&gt; &gt; _______________________________________________<br>&gt; &gt; rules-users mailing list<br>&gt; &gt; rules-users@lists.jboss.org<br>&gt; &gt; https://lists.jboss.org/mailman/listinfo/rules-users<br>&gt; &gt; <br>&gt; &gt; <br>&gt; <br>&gt; -- <br>&gt; View this message in context: http://www.nabble.com/unable-to-resolve-method-using-strict-mode-tp25718123p25744948.html<br>&gt; Sent from the drools - user mailing list archive at Nabble.com.<br>&gt; <br>&gt; <br>&gt; _______________________________________________<br>&gt; rules-users mailing list<br>&gt; rules-users@lists.jboss.org<br>&gt; https://lists.jboss.org/mailman/listinfo/rules-users<br>                                               <br /><hr />Hotmail: Trusted email with Microsoft’s powerful SPAM protection. <a href='http://clk.atdmt.com/GBL/go/177141664/direct/01/' target='_new'>Sign up now.</a></body>
</html>