<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}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
        {color:#0563C1;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:#954F72;
        text-decoration:underline}
span.EmailStyle17
        {font-family:"Calibri","sans-serif";
        color:windowtext}
.MsoChpDefault
        {}
@page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
div.WordSection1
        {}
ol
        {margin-bottom:0cm}
ul
        {margin-bottom:0cm}
-->
</style>
</head>
<body lang="EN-IN" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<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="margin-left:0cm; text-indent:-18.0pt; line-height:15.0pt; background:whitesmoke">
<span style="font-size:10.5pt; font-family:"Arial","sans-serif"; color:#333333"><span style="">1.<span style="font:7.0pt "Times New Roman"">
</span></span></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"> synchronized(this)</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>
<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>