<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Manukyan, Sergey wrote:
<blockquote
 cite="mid:4E03EDD62CB1CB4599E6BD71DBEDFD2002B1396C@usmitry-exm1.corp.lear.com"
 type="cite">
  <pre wrap="">Ekke,

Thanks a lot! It worked just fine...

The other missing point is that after deserializing the PackageBuilder
should be buit as in your example :

        builder = new PackageBuilder((Package)ois.readObject());

and later on from that isnatcne should be retrieved the Package inctance
by doing:

        package = buider.getPackage();

as otherwise this code was failing:
        
        package = (Package)ois.readObject();  // FAILES, subsequent use
of package produces "class not found" exception when inserting objects.



Mark,

Think this should be documented somewhere in manual... under  IMPORTANT
section... by the way, IMHO that section should be more visible from
what is used currently in manual... - thin italic font, how about bold
red?

  </pre>
</blockquote>
You should be able to serialise a Package without having to first add
it to PackageBuilder, we have numerous&nbsp; tests for this.<br>
<blockquote
 cite="mid:4E03EDD62CB1CB4599E6BD71DBEDFD2002B1396C@usmitry-exm1.corp.lear.com"
 type="cite">
  <pre wrap="">
Thanks to all,

-Sergey
        


-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>
[<a class="moz-txt-link-freetext" href="mailto:rules-users-bounces@lists.jboss.org">mailto:rules-users-bounces@lists.jboss.org</a>] On Behalf Of ekke
Sent: Tuesday, October 09, 2007 2:35 PM
To: <a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
Subject: [rules-users] RE: RE: rules precompilation


Sergey,

of course Mark is right - you shouldn't use readExternal and the default
constructor.
this was my fault from an earlier mail.

please try something like this:

// EXPORT
...
FileOutputStream fos .....
...
ObjectOutputStream oos = null;
                try {
                        oos = new ObjectOutputStream(fos);
                        oos.writeObject(builder.getPackage());
                        oos.close();
                } catch (final IOException e) {
                        ... your code....
                }
...

// IMPORT
FileInputStream fis...
...
ObjectInputStream ois = null;
                try {
                        ois = new ObjectInputStream(fis);
                        builder = new
PackageBuilder((Package)ois.readObject());
                        ois.close();
                } catch (final IOException e) {
                        ...your code...;
                } catch (final ClassNotFoundException e) {
                        ...your code...;
                }

now your imported package should work like the exported

ekke


Manukyan, Sergey wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Ekke,

Started using 4.0.2, but getting same error.

This is how I am loading the Package :

this.pkg = new Package();
this.pkg.readExternal(ois);

Does that look right to you?

-Sergey



-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>
[<a class="moz-txt-link-freetext" href="mailto:rules-users-bounces@lists.jboss.org">mailto:rules-users-bounces@lists.jboss.org</a>] On Behalf Of ekke
Sent: Wednesday, October 03, 2007 4:08 PM
To: <a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
Subject: [rules-users] RE: rules precompilation


sergey,

just tried it:
exported a package with rules as stream
(using the writeExternal() from Package)

then in another run I created new RuleBase, added new Package,
then import the rules into this empty Package (using the
    </pre>
  </blockquote>
  <pre wrap=""><!---->readExternal()
  </pre>
  <blockquote type="cite">
    <pre wrap="">from
Package)
then added some facts, execute the rules,

tested if all rules are there,
tested if the Facts are in workingMemory - all ok

(using snapshot 4.0.2, eclipse 3.3, osx 10.4.10)

ekke

Manukyan, Sergey wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">Ming, Ekke,

After deserialising the Package back - getting exception when
      </pre>
    </blockquote>
    <pre wrap="">inserting
    </pre>
    <blockquote type="cite">
      <pre wrap="">facts:

Exception thrown : java.lang.NoClassDefFoundError: XXXShadowProxy

XXX - is my class name

Any ideas?

-Sergey



-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>
[<a class="moz-txt-link-freetext" href="mailto:rules-users-bounces@lists.jboss.org">mailto:rules-users-bounces@lists.jboss.org</a>] On Behalf Of Jin, Ming
Sent: Wednesday, October 03, 2007 1:50 PM
To: Rules Users List
Subject: RE: [rules-users] rules precompilation

Sergey,

I am using precompiled rules.  Serializing instances of
org.drools.rule.Package works for me.

Thanks,
-Ming 

-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>
[<a class="moz-txt-link-freetext" href="mailto:rules-users-bounces@lists.jboss.org">mailto:rules-users-bounces@lists.jboss.org</a>] On Behalf Of Manukyan,
Sergey
Sent: Wednesday, October 03, 2007 12:29 PM
To: Rules Users List
Subject: [rules-users] rules precompilation


Folks,

Where can I find information on how to pre-compile rules in 4.0.1?

Thanks,

-Sergey


**********************
** LEGAL DISCLAIMER **
**********************

This E-mail message and any attachments may contain legally
      </pre>
    </blockquote>
    <pre wrap="">privileged,
    </pre>
    <blockquote type="cite">
      <pre wrap="">confidential or proprietary information. If you are not the intended
recipient(s), or the employee or agent responsible for delivery of
      </pre>
    </blockquote>
    <pre wrap="">this
    </pre>
    <blockquote type="cite">
      <pre wrap="">message to the intended recipient(s), you are hereby notified that
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->any
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">dissemination, distribution or copying of this E-mail message is
strictly prohibited. If you have received this message in error,
      </pre>
    </blockquote>
    <pre wrap="">please
    </pre>
    <blockquote type="cite">
      <pre wrap="">immediately notify the sender and delete this E-mail message from
      </pre>
    </blockquote>
  </blockquote>
  <pre wrap=""><!---->your
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">computer.

_______________________________________________
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>

_______________________________________________
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>

_______________________________________________
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>
    <pre wrap="">-- 
View this message in context:

    </pre>
  </blockquote>
  <pre wrap=""><!----><a class="moz-txt-link-freetext" href="http://www.nabble.com/How-to-have-your-emails-ignored-tf4562290.html#a13">http://www.nabble.com/How-to-have-your-emails-ignored-tf4562290.html#a13</a>
  </pre>
  <blockquote type="cite">
    <pre wrap="">026864
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
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>

_______________________________________________
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>
  <pre wrap=""><!---->
  </pre>
</blockquote>
<br>
</body>
</html>