<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="&#1;" xmlns="http://www.w3.org/TR/REC-html40">

<head>

<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
h3
        {mso-style-priority:9;
        mso-style-link:"Überschrift 3 Zchn";
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:13.5pt;
        font-family:"Times New Roman","serif";
        font-weight:bold;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Nur Text Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.berschrift3Zchn
        {mso-style-name:"Überschrift 3 Zchn";
        mso-style-priority:9;
        mso-style-link:"Überschrift 3";
        font-weight:bold;}
span.HTMLVorformatiertZchn
        {mso-style-name:"HTML Vorformatiert Zchn";
        mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert";
        font-family:"Courier New";}
span.NurTextZchn
        {mso-style-name:"Nur Text Zchn";
        mso-style-priority:99;
        mso-style-link:"Nur Text";
        font-family:Consolas;}
p.title, li.title, div.title
        {mso-style-name:title;
        mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.E-MailFormatvorlage25
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.E-MailFormatvorlage26
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.E-MailFormatvorlage27
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=DE link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Has anybody an idea
what&#8217;s these problems? I didn&#8217;t find any test cases, are there any test cases
for serializing the PKG files? What am I doing wrong?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <b>Im Auftrag von </b>Bernd Rücker<br>
<b>Gesendet:</b> Dienstag, 1. September 2009 17:26<br>
<b>An:</b> rules-users@lists.jboss.org<br>
<b>Betreff:</b> [rules-users] WG: Serialization of packages: InvalidClassException
/ serialVersionUID<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>The exception of the
KnowledgePackage serialization (by the way, this is described in the docs, that
you can serialize the KnowledgePackages!):<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoPlainText><span lang=EN-US>/home/bruecker/workspace/1/iKS2/iks_drools_rules/drools-rules.pkg<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-US>Exception in thread &quot;main&quot;
java.io.NotSerializableException: <o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-US>org.drools.definitions.impl.KnowledgePackageImp<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-US>&nbsp;&nbsp;&nbsp; at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-US>&nbsp;&nbsp;&nbsp; at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-US>&nbsp;&nbsp;&nbsp; at <o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-US>org.drools.util.DroolsStreamUtils.streamOut(DroolsStreamUtils.java:79)<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-US>&nbsp;&nbsp;&nbsp; at <o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-US>org.drools.util.DroolsStreamUtils.streamOut(DroolsStreamUtils.java:61)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>So this doesn&#8217;t work
either
(http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html_single/index.html#d0e992):<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span
lang=EN-US style='font-size:13.5pt;font-family:"Times New Roman","serif"'>3.2.4.&nbsp;Building
and Deployment in Separate Processes<o:p></o:p></span></b></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'>Both
the </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>KnowledgeBase</span><span
lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'> and
the </span><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>KnowledgePackage</span><span
lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'> are
units of deployment and serializable. This means you can have one machine do
any necessary building, requiring </span><span lang=EN-US style='font-size:
10.0pt;font-family:"Courier New"'>drools-compiler.jar</span><span lang=EN-US
style='font-size:12.0pt;font-family:"Times New Roman","serif"'>, and have
another machine deploy and execute everything, needing only </span><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>drools-core.jar</span><span
lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'>.<o:p></o:p></span></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'>Although
serialization is standard Java, we present an example of how one machine might
write out the deployment unit and how another machine might read in and use
that deployment unit.<o:p></o:p></span></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span
lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'>Example&nbsp;3.15.&nbsp;Writing
the KnowledgePackage to an OutputStream</span></b><span lang=EN-US
style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>ObjectOutputStream
out = new ObjectOutputStream( new FileOutputStream( fileName ) );<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>out.writeObject(
kpkgs );<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>out.close();<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span
lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'>Example&nbsp;3.16.&nbsp;Reading
the KnowledgePackage from an InputStream</span></b><span lang=EN-US
style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>ObjectInputStream
in = new ObjectInputStream( new FileInputStream( fileName ) );<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>//
The input stream might contain an individual<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>//
package or a collection.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>@SuppressWarnings(
&quot;unchecked&quot; )<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>Collection&lt;KnowledgePackage&gt;
kpkgs =<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;
()in.readObject( Collection&lt;KnowledgePackage&gt; );<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>in.close();<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>KnowledgeBase
kbase = KnowledgeBaseFactory.newKnowledgeBase();<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>kbase.addKnowledgePackages(
kpkgs );<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'>The </span><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>KnowledgeBase</span><span
lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'> is
also serializable and some people may prefer to build and then store the </span><span
lang=EN-US style='font-size:10.0pt;font-family:"Courier New"'>KnowledgeBase</span><span
lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'>
itself, instead of the Knowledge Packages.<o:p></o:p></span></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
lang=EN-US style='font-size:12.0pt;font-family:"Times New Roman","serif"'>Drools
Guvnor, our server side management system, uses this deployment approach. After
Guvnor has compiled and published serialized Knowledge Packages on a URL,
Drools can use the URL resource type to load them.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Bernd Rücker
[mailto:bernd.ruecker@camunda.com] <br>
<b>Gesendet:</b> Dienstag, 1. September 2009 17:21<br>
<b>An:</b> 'rules-users@lists.jboss.org'<br>
<b>Betreff:</b> Serialization of packages: InvalidClassException /
serialVersionUID <o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Hi!<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span lang=EN-US>I really struggled some time with
serialization issues: I want to create a pkg and package that with the jar.
&gt;From there I want to read it during runtime.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Easy I thought. Drools 5 way should be to
serialize the KnowledgeBase, right? At least, this is what the AntTask does.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>If I try to serialize the KnowledgePackage
I get an excpetion anyway:<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoPlainText><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoPlainText><span lang=EN-US>Okay. Back to the KnowledgeBase. Serialized
with Drools 5.0.0.M4 and try to read it with 5.0.0.M5:<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoPlainText><span lang=EN-US>Caused by:
java.io.InvalidClassException: <o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-US>&nbsp;
org.drools.impl.KnowledgeBaseImpl; <o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-US>&nbsp; local class incompatible: stream
classdesc serialVersionUID = -4540376767025107954,<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-US>&nbsp;&nbsp;local class serialVersionUID
= -3186110098262381425<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>So it seems Drools Packages are NOT
compatible between minor versions? This would be a disaster for deployment. Or
do I serialize the wrong thing? Unfortunately I didn&#8217;t find anything in the
docs about it.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Then I tried to do it the &#8220;old&#8221; Drools 4
way and serialize Package objects, but same problem with a different
serialVersionUID!<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Why do these important classes don&#8217;t have a
serialVersionUID? Or how should that be loaded? Must be a big issue with
Govner, so I think there must be a solution already?<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Thanks for any help!<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Cheers<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US>Bernd </span><o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>