<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=051271415-16012009><FONT face=Arial 
color=#0000ff size=2>OK, found the problem!</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=051271415-16012009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=051271415-16012009><FONT face=Arial 
color=#0000ff size=2>In my package I was having a model "testModel" that had no 
facts declared.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=051271415-16012009><FONT face=Arial 
color=#0000ff size=2>This was causing the NPE when building the 
package.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=051271415-16012009><FONT face=Arial 
color=#0000ff size=2>So I think we need to check for this case or not allow the 
user to do this.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=051271415-16012009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=051271415-16012009><FONT face=Arial 
color=#0000ff size=2>--zoly</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=051271415-16012009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=051271415-16012009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> rules-dev-bounces@lists.jboss.org 
[mailto:rules-dev-bounces@lists.jboss.org] <B>On Behalf Of </B>Zoltan 
Farkas<BR><B>Sent:</B> Friday, January 16, 2009 9:51 AM<BR><B>To:</B> Rules Dev 
List<BR><B>Subject:</B> RE: [rules-dev] NPE when building 
package<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=390524114-16012009><FONT face=Arial 
color=#0000ff size=2>Yes, I did a standalone test and in 
passes.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=390524114-16012009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=390524114-16012009><FONT face=Arial 
color=#0000ff size=2>In my test I used the text version of the package from 
guvnor, that I believe is generated by 
ContentPackageAssembler.getDRL().</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=390524114-16012009><FONT face=Arial 
color=#0000ff size=2>however PackageBuilder has no issues with that 
version.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=390524114-16012009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=390524114-16012009><FONT face=Arial 
color=#0000ff size=2>Now my next place to investigate is guvnors 
ContentPackageAssembly... </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=390524114-16012009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=390524114-16012009><FONT face=Arial 
color=#0000ff size=2>and the NPE happens as I can see from the stack trace in: 
ContentPackageAssembly.loadDeclaredTypes.</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=390524114-16012009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=390524114-16012009>If you 
have any sugestions to better approach solving this problem let me know. As it 
is right now I will look into the code and try to understand what is going 
on.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=390524114-16012009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=390524114-16012009>regards</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=390524114-16012009></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN 
class=390524114-16012009>--zoly</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> rules-dev-bounces@lists.jboss.org 
[mailto:rules-dev-bounces@lists.jboss.org] <B>On Behalf Of </B>Mark 
Proctor<BR><B>Sent:</B> Thursday, January 15, 2009 6:26 PM<BR><B>To:</B> Rules 
Dev List<BR><B>Subject:</B> Re: [rules-dev] NPE when building 
package<BR></FONT><BR></DIV>
<DIV></DIV>Zoltan Farkas wrote: 
<BLOCKQUOTE 
cite=mid:A483EB3CA9C69D41AEC537D1C7C2CAFF037EFE8B@34093-C3-EVS2.exchange.rackspace.com 
type="cite">
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
  class=764022422-15012009>Hi Mark, I need to have the unit test inside guvnor 
  or another project that depends on it.</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
  class=764022422-15012009></SPAN></FONT>&nbsp;</DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
  class=764022422-15012009>The code fails in guvnor when I do build 
  package.</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
  class=764022422-15012009></SPAN></FONT>&nbsp;</DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
  class=764022422-15012009>and I believe the problem might be related to 
  BRMSPackageBuilder that inherits from PackageBuilder or 
  ContentPackageAssembler</SPAN></FONT></DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
  class=764022422-15012009></SPAN></FONT>&nbsp;</DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
  class=764022422-15012009>where should I create the unit test 
  ?</SPAN></FONT></DIV></BLOCKQUOTE>Have you tried doing this as a standalone unit 
test first? As the problem will be in the PackageBuilder, not in the Guvnor. 
Just following one of the examples in MiscTest.<BR><BR>Mark<BR>
<BLOCKQUOTE 
cite=mid:A483EB3CA9C69D41AEC537D1C7C2CAFF037EFE8B@34093-C3-EVS2.exchange.rackspace.com 
type="cite">
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
  class=764022422-15012009></SPAN></FONT>&nbsp;</DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
  class=764022422-15012009></SPAN></FONT>&nbsp;</DIV>
  <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
  class=764022422-15012009>--zoly</SPAN></FONT></DIV><BR>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> <A class=moz-txt-link-abbreviated 
  href="mailto:rules-dev-bounces@lists.jboss.org">rules-dev-bounces@lists.jboss.org</A> 
  [<A class=moz-txt-link-freetext 
  href="mailto:rules-dev-bounces@lists.jboss.org">mailto:rules-dev-bounces@lists.jboss.org</A>] 
  <B>On Behalf Of </B>Mark Proctor<BR><B>Sent:</B> Thursday, January 15, 2009 
  4:48 PM<BR><B>To:</B> Rules Dev List<BR><B>Subject:</B> Re: [rules-dev] NPE 
  when building package<BR></FONT><BR></DIV>Zoltan Farkas wrote: 
  <BLOCKQUOTE 
  cite=mid:A483EB3CA9C69D41AEC537D1C7C2CAFF037EFDC2@34093-C3-EVS2.exchange.rackspace.com 
  type="cite">
    <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
    class=132563021-15012009>the actual package namespace contains dots, I 
    removed them for privacy purposes.</SPAN></FONT></DIV></BLOCKQUOTE>ok, can i 
  ask you to make a unit test for me, that I can put into MiscTest ?<BR><A 
  class=moz-txt-link-freetext 
  href="http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java" 
  moz-do-not-send="true">http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java</A><BR><BR>Thanks<BR><BR>Mark<BR>
  <BLOCKQUOTE 
  cite=mid:A483EB3CA9C69D41AEC537D1C7C2CAFF037EFDC2@34093-C3-EVS2.exchange.rackspace.com 
  type="cite">
    <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
    class=132563021-15012009></SPAN></FONT>&nbsp;</DIV>
    <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
    class=132563021-15012009>--zoly</SPAN></FONT></DIV><BR>
    <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
    <HR tabIndex=-1>
    <FONT face=Tahoma size=2><B>From:</B> <A class=moz-txt-link-abbreviated 
    href="mailto:rules-dev-bounces@lists.jboss.org" 
    moz-do-not-send="true">rules-dev-bounces@lists.jboss.org</A> [<A 
    class=moz-txt-link-freetext href="mailto:rules-dev-bounces@lists.jboss.org" 
    moz-do-not-send="true">mailto:rules-dev-bounces@lists.jboss.org</A>] <B>On 
    Behalf Of </B>Mark Proctor<BR><B>Sent:</B> Thursday, January 15, 2009 4:26 
    PM<BR><B>To:</B> Rules Dev List<BR><B>Subject:</B> Re: [rules-dev] NPE when 
    building package<BR></FONT><BR></DIV>Zoltan Farkas wrote: 
    <BLOCKQUOTE 
    cite=mid:A483EB3CA9C69D41AEC537D1C7C2CAFF037EFCE5@34093-C3-EVS2.exchange.rackspace.com 
    type="cite">
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
      class=620063120-15012009>I am getting a NPE when building a package with 
      guvnor:</SPAN></FONT></DIV></BLOCKQUOTE>I think it might be a bug when a 
    package namespace doesn't have a dot in it.<BR><BR>Mark<BR>
    <BLOCKQUOTE 
    cite=mid:A483EB3CA9C69D41AEC537D1C7C2CAFF037EFCE5@34093-C3-EVS2.exchange.rackspace.com 
    type="cite">
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
      class=620063120-15012009></SPAN></FONT>&nbsp;</DIV>
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
      class=620063120-15012009></SPAN></FONT>&nbsp;</DIV><FONT face=Arial 
      color=#0000ff 
      size=2>java.lang.NullPointerException<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      at 
      org.drools.compiler.PackageBuilder.validateUniqueRuleNames(PackageBuilder.java:826)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      at 
      org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:548)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      at 
      org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:287)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      at 
      org.drools.guvnor.server.builder.ContentPackageAssembler.loadDeclaredTypes(ContentPackageAssembler.java:249)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      at 
      org.drools.guvnor.server.builder.ContentPackageAssembler.preparePackage(ContentPackageAssembler.java:216)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      at 
      org.drools.guvnor.server.builder.ContentPackageAssembler.&lt;init&gt;(ContentPackageAssembler.java:103)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      at 
      org.drools.guvnor.server.builder.ContentPackageAssembler.&lt;init&gt;(ContentPackageAssembler.java:117)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      at 
      org.drools.guvnor.server.ServiceImplementation.buildPackage(ServiceImplementation.java:1366)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      at 
      org.drools.guvnor.server.ServiceImplementation.buildPackage(ServiceImplementation.java:1350)<BR></FONT>
      <DIV dir=ltr align=left>&nbsp;</DIV>
      <DIV dir=ltr align=left>&nbsp;</DIV>
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
      class=620063120-15012009>here is my package source:</SPAN></FONT></DIV>
      <DIV dir=ltr align=left>&nbsp;</DIV>
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
      size=2>package&nbsp;<SPAN 
      class=620063120-15012009>MyTest</SPAN><BR>import&nbsp;<SPAN 
      class=620063120-15012009>pack</SPAN>.EventVO<BR>import <SPAN 
      class=620063120-15012009>pack</SPAN>.ExtendedEventVO<BR></FONT></DIV>
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>declare 
      ExtendedEventVO<BR>&nbsp;&nbsp;&nbsp; @role( event )<BR>end</FONT></DIV>
      <DIV>&nbsp;</DIV>
      <DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>rule 
      "Test"<BR>&nbsp;dialect 
      "mvel"<BR>&nbsp;when<BR>&nbsp;&nbsp;ExtendedEventVO( 
      )<BR>&nbsp;then<BR>&nbsp;&nbsp;System.out.println("Hello World, events 
      happen!!!")<BR>end</FONT></DIV>
      <DIV dir=ltr align=left><BR><FONT face=Arial color=#0000ff size=2>rule 
      'TestEntryPoint'<BR>dialect 
      'mvel'<BR>&nbsp;when<BR>&nbsp;&nbsp;ExtendedEventVO() from entry-point 
      eventDoor<BR>&nbsp;then<BR>&nbsp;&nbsp;System.out.println("Hello World, 
      events happen!!!")<BR>end</FONT></DIV>
      <DIV dir=ltr align=left>&nbsp;</DIV>
      <DIV dir=ltr align=left><SPAN class=620063120-15012009><FONT face=Arial 
      color=#0000ff size=2>This seems like a possible BUG.</FONT></SPAN></DIV>
      <DIV dir=ltr align=left><SPAN class=620063120-15012009></SPAN>&nbsp;</DIV>
      <DIV dir=ltr align=left><SPAN class=620063120-15012009><FONT face=Arial 
      color=#0000ff size=2>Let me know, thanks</FONT></SPAN></DIV>
      <DIV dir=ltr align=left><SPAN class=620063120-15012009></SPAN>&nbsp;</DIV>
      <DIV dir=ltr align=left><SPAN class=620063120-15012009><FONT face=Arial 
      color=#0000ff size=2>--zoly</FONT></SPAN></DIV><PRE wrap=""><HR width="90%" SIZE=4>
_______________________________________________
rules-dev mailing list
<A class=moz-txt-link-abbreviated href="mailto:rules-dev@lists.jboss.org" moz-do-not-send="true">rules-dev@lists.jboss.org</A>
<A class=moz-txt-link-freetext href="https://lists.jboss.org/mailman/listinfo/rules-dev" moz-do-not-send="true">https://lists.jboss.org/mailman/listinfo/rules-dev</A>
  </PRE></BLOCKQUOTE><BR><PRE wrap=""><HR width="90%" SIZE=4>
_______________________________________________
rules-dev mailing list
<A class=moz-txt-link-abbreviated href="mailto:rules-dev@lists.jboss.org" moz-do-not-send="true">rules-dev@lists.jboss.org</A>
<A class=moz-txt-link-freetext href="https://lists.jboss.org/mailman/listinfo/rules-dev" moz-do-not-send="true">https://lists.jboss.org/mailman/listinfo/rules-dev</A>
  </PRE></BLOCKQUOTE><BR><PRE wrap=""><HR width="90%" SIZE=4>
_______________________________________________
rules-dev mailing list
<A class=moz-txt-link-abbreviated href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</A>
<A class=moz-txt-link-freetext href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</A>
  </PRE></BLOCKQUOTE><BR></BODY></HTML>