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. Hi Mark, I need to have the unit test inside guvnor or another project that depends on it.The code fails in guvnor when I do build package.and I believe the problem might be related to BRMSPackageBuilder that inherits from PackageBuilder or ContentPackageAssemblerwhere should I create the unit test ?
--zoly
Zoltan Farkas wrote:
From: rules-dev-bounces@lists.jboss.org [mailto:rules-dev-bounces@lists.jboss.org] On Behalf Of Mark Proctor
Sent: Thursday, January 15, 2009 4:48 PM
To: Rules Dev List
Subject: Re: [rules-dev] NPE when building package
ok, can i ask you to make a unit test for me, that I can put into MiscTest ?the actual package namespace contains dots, I removed them for privacy purposes.
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
Thanks
Mark
--zoly
Zoltan Farkas wrote:
From: rules-dev-bounces@lists.jboss.org [mailto:rules-dev-bounces@lists.jboss.org] On Behalf Of Mark Proctor
Sent: Thursday, January 15, 2009 4:26 PM
To: Rules Dev List
Subject: Re: [rules-dev] NPE when building package
I think it might be a bug when a package namespace doesn't have a dot in it.I am getting a NPE when building a package with guvnor:
Mark
java.lang.NullPointerException
at org.drools.compiler.PackageBuilder.validateUniqueRuleNames(PackageBuilder.java:826)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:548)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:287)
at org.drools.guvnor.server.builder.ContentPackageAssembler.loadDeclaredTypes(ContentPackageAssembler.java:249)
at org.drools.guvnor.server.builder.ContentPackageAssembler.preparePackage(ContentPackageAssembler.java:216)
at org.drools.guvnor.server.builder.ContentPackageAssembler.<init>(ContentPackageAssembler.java:103)
at org.drools.guvnor.server.builder.ContentPackageAssembler.<init>(ContentPackageAssembler.java:117)
at org.drools.guvnor.server.ServiceImplementation.buildPackage(ServiceImplementation.java:1366)
at org.drools.guvnor.server.ServiceImplementation.buildPackage(ServiceImplementation.java:1350)
here is my package source:package MyTest
import pack.EventVO
import pack.ExtendedEventVO
declare ExtendedEventVO
@role( event )
endrule "Test"
dialect "mvel"
when
ExtendedEventVO( )
then
System.out.println("Hello World, events happen!!!")
end
rule 'TestEntryPoint'
dialect 'mvel'
when
ExtendedEventVO() from entry-point eventDoor
then
System.out.println("Hello World, events happen!!!")
endThis seems like a possible BUG.Let me know, thanks--zoly
_______________________________________________ rules-dev mailing list rules-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-dev
_______________________________________________ rules-dev mailing list rules-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-dev
_______________________________________________ rules-dev mailing list rules-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-dev