<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">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:<br>
</div>
<blockquote
cite="mid:ADE3589E38775849B7CC3DF2148FCD0B0A879682@MMT-SRV-XDB3.mmt.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<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>
<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 moz-do-not-send="true"
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.
</font></h5>
<font color="gray">
</font>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></pre>
</blockquote>
<br>
</body>
</html>