<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style>
<!--
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
@font-face
        {font-family:Consolas}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black}
h5
        {margin-right:0cm;
        margin-left:0cm;
        font-size:10.0pt;
        font-family:"Times New Roman","serif";
        color:black}
a:link, span.MsoHyperlink
        {color:#0563C1;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:#954F72;
        text-decoration:underline}
pre
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black}
span.emailstyle17
        {font-family:"Calibri","sans-serif";
        color:windowtext}
span.Heading5Char
        {font-family:"Calibri Light","sans-serif";
        color:#2E74B5}
span.HTMLPreformattedChar
        {font-family:"Consolas","serif";
        color:black}
span.EmailStyle21
        {font-family:"Calibri","sans-serif";
        color:#1F497D}
.MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
div.WordSection1
        {}
-->
</style>
</head>
<body bgcolor="white" lang="EN-IN" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">@David- thanks for your reply.</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">In the patch, we have applied synchronise block, we referred to 6.0.0 release.</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">Still it’s throwing LinkageError for the same,
</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="color:#1F497D">Regards,</span></p>
<p class="MsoNormal"><span style="color:#1F497D">Karan</span></p>
<p class="MsoNormal"><span style="color:#1F497D"> </span></p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="color:windowtext">From:</span></b><span lang="EN-US" style="color:windowtext"> rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org]
<b>On Behalf Of </b>Davide Sottara<br>
<b>Sent:</b> 05 April 2014 12:19<br>
<b>To:</b> rules-users@lists.jboss.org<br>
<b>Subject:</b> Re: [rules-users] Linkage Error In execute method</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<div>
<p class="MsoNormal">Can you upgrade to 5.6?<br>
Otherwise, you'll have to synchronize the methods int ClassLoader, the null check is not enough<br>
<br>
On 04/04/2014 09:16 PM, Karan Malhotra wrote:<span style="font-size:12.0pt"></span></p>
</div>
<blockquote style="margin-top:5.0pt; margin-bottom:5.0pt">
<div>
<p class="MsoNormal">Hi All,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">We have recently upgraded our application from 5.1.0 to 5.4.0.Final.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Everything worked well until this was deployed at Production Envr. We started getting multiple Linkage Error in execute method of Stateless KnowledgeSession.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">StackTrace:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Exception: java.util.concurrent.ExecutionException: java.lang.LinkageError: loader (instance oforg/drools/rule/JavaDialectRuntimeData$PackageClassLoader): attemptedduplicate class definition for name: "OffBarCapping/Rule_Off_Bar_Tariff_Capping_13_2a4a909def69414bbd60cdfdac9ad807"|</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">OffBarCapping/Rule_Off_Bar_Tariff_Capping_16_6b6f1282708449448fc434e820fa8e1f# at OffBarCapping.Rule_Off_Bar_Tariff_Capping_16_6b6f1282708449448fc434e820fa8e1fPredicate0InvokerGenerated.evaluate(Unknown Source)# at OffBarCapping.Rule_Off_Bar_Tariff_Capping_16_6b6f1282708449448fc434e820fa8e1fPredicate0Invoker.evaluate(Unknown
Source)# at org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:299)# at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)# at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)#
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)# at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)# at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)#
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:337)# at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:298)# at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:888)# at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)#
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)# at org.drools.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:294)#</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="text-indent:-18.0pt; line-height:15.0pt; background:whitesmoke">
<span style="font-size:10.5pt; font-family:"Arial","sans-serif"; color:#333333">1.</span><span style="font-size:7.0pt; font-family:"Times New Roman","serif"; color:#333333">
</span>Some surfing on the internet referred us to a similar JIRA issue:- <span style="font-size:10.5pt; font-family:"Arial","sans-serif"; color:#333333">
<a href="https://issues.jboss.org/browse/JBRULES-3675"><span style="color:#333333; text-decoration:none">JBRULES-3675</span></a></span></p>
<p class="MsoNormal">It says this has been fixed in 6.0.0. We were not in a position to upgrade to 6.0.0 right away and hence decide to apply a patch in drools-core-5.4.0.Final.jar</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Drools: 5.4.0</p>
<p class="MsoNormal">public Class<?> More ...fastFindClass( final String name ) {</p>
<p class="MsoNormal"> Class<?> cls = findLoadedClass( name );</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> if (cls == null) {</p>
<p class="MsoNormal"> final byte[] clazzBytes = this.store.read( convertClassToResourcePath( name ) );</p>
<p class="MsoNormal"> if (clazzBytes != null) {</p>
<p class="MsoNormal"> String pkgName = name.substring( 0,</p>
<p class="MsoNormal"> name.lastIndexOf( '.' ) );</p>
<p class="MsoNormal"> if (getPackage( pkgName ) == null) {</p>
<p class="MsoNormal"> definePackage( pkgName,</p>
<p class="MsoNormal"> "",</p>
<p class="MsoNormal"> "",</p>
<p class="MsoNormal"> "",</p>
<p class="MsoNormal"> "",</p>
<p class="MsoNormal"> "",</p>
<p class="MsoNormal"> "",</p>
<p class="MsoNormal"> null );</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> cls = defineClass( name,</p>
<p class="MsoNormal"> clazzBytes,</p>
<p class="MsoNormal"> 0,</p>
<p class="MsoNormal"> clazzBytes.length,</p>
<p class="MsoNormal"> PROTECTION_DOMAIN );</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"> if (cls != null) {</p>
<p class="MsoNormal"> resolveClass( cls );</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"> return cls;</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Path applied:- </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">public Class fastFindClass(String name)</p>
<p class="MsoNormal"> {</p>
<p class="MsoNormal"> Class cls = findLoadedClass(name);</p>
<p class="MsoNormal"> if(cls == null)</p>
<p class="MsoNormal"> {</p>
<p class="MsoNormal"> byte clazzBytes[] = store.read(JavaDialectRuntimeData.convertClassToResourcePath(name));</p>
<p class="MsoNormal"> if(clazzBytes != null)</p>
<p class="MsoNormal"> {</p>
<p class="MsoNormal"> String pkgName = name.substring(0, name.lastIndexOf('.'));</p>
<p class="MsoNormal"> if(!existingPackages.contains(pkgName))</p>
<p class="MsoNormal"> {</p>
<p class="MsoNormal"> <b>synchronized(this)</b></p>
<p class="MsoNormal"> {</p>
<p class="MsoNormal"> if(!existingPackages.contains(pkgName))</p>
<p class="MsoNormal"> {</p>
<p class="MsoNormal"> if(getPackage(pkgName) == null)</p>
<p class="MsoNormal"> {</p>
<p class="MsoNormal"> definePackage(pkgName, "", "", "", "", "", "", null);</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"> existingPackages.add(pkgName);</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"> cls = defineClass(name, clazzBytes, 0, clazzBytes.length, JavaDialectRuntimeData.access$000());</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"> if(cls != null)</p>
<p class="MsoNormal"> {</p>
<p class="MsoNormal"> resolveClass(cls);</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"> return cls;</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">But we are still getting this Error.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Let me know if any one did face a similar issue and solution for the same.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Thanks and regards,</p>
<p class="MsoNormal">Karan Malhotra</p>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt; font-family:"Times New Roman","serif""> </span></p>
<h5><span style="color:gray">The contents of this email, including the attachments, are PRIVILEGED AND CONFIDENTIAL to the intended recipient at the email address to which it has been addressed. If you receive it in error, please notify the sender immediately
by return email and then permanently delete it from your system. The unauthorized use, distribution, copying or alteration of this email, including the attachments, is strictly forbidden. Please note that neither MakeMyTrip nor the sender accepts any responsibility
for viruses and it is your responsibility to scan the email and attachments (if any). No contracts may be concluded on behalf of MakeMyTrip by means of email communications.
</span></h5>
<p class="MsoNormal"><span style="font-size:12.0pt; font-family:"Times New Roman","serif""><br>
<br>
<br>
</span></p>
<pre>_______________________________________________</pre>
<pre>rules-users mailing list</pre>
<pre><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a></pre>
<pre><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt; font-family:"Times New Roman","serif""> </span></p>
</div>
<br>
<h5><font color="gray">The contents of this email, including the attachments, are
<b>PRIVILEGED AND CONFIDENTIAL</b> to the intended recipient at the email address to which it has been addressed. If you receive it in error, please notify the sender immediately by return email and then permanently delete it from your system. The unauthorized
use, distribution, copying or alteration of this email, including the attachments, is strictly forbidden. Please note that neither MakeMyTrip nor the sender accepts any responsibility for viruses and it is your responsibility to scan the email and attachments
(if any). No contracts may be concluded on behalf of <b>MakeMyTrip</b> by means of email communications.
</h5>
</font>
</body>
</html>