Integrating Drools5.0 into J2EE APP
by Sumant Kumar
Hi,
Can somebody describe in a high level how the Drools components ( Guvnor,Expert, etc) are integrated into J2EE app.
I am looking for these items as part of Drools deployment configuration
1) How are rules saved ( File system or DB )
2) How is rule versioning enabled ( with Subversion )
3) Rules and RuleSet granularity . How many rules should go in one DRL.
4) Facts: Are facts defined as POJOs and uploaded to Drools or Declarative FACTs are defined in Drools Guvnor
Any links over the web will be great too.
thanks
Sam
15 years, 5 months
Re: [rules-users] Run Drool Application From Command Prompt
by Pankaj.Jain@lntinfotech.com
Hi
I still have not got any solution of my problem that I posted previously.
I have included all required jar files and set proper class path .. Please
do help ?
problem:
I am trying to integrate Drool with ofbiz and run application from command
prompt. In one way I have integrated it properly and I am able to run it
successfully.
Code : Which I was using initially
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
or
PackageBuilderConfiguration cfg = new PackageBuilderConfiguration();
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
Exception I got :
org.drools.RuntimeDroolsException: Unable to load dialect
'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java
:org.drools.rule.builder.dialect.java.JavaDialectConfiguration'
at
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:274)
at
org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:259)
at
org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:176)
at
org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:153)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:242)
.
.
.
Caused by: java.lang.NullPointerException
at
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:92)
at
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:55)
at
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:270
Problem I found :
In the class JavaDialectConfiguration in jar file drools-compiler.jar
there is a method named "setCompliler", in this method Null Pointer
Exception was coming.
Solution I provided :
In my application I created my custom class CustomJavaDialectConfiguration
by extending to class JavaDialectConfiguration, In this class I overrided
the method setCompiler. My method was exactly same as that of method
setCompiler in JavaDialectConfiguration . To call my dialect class I also
overrided the method "addDialect" of PackageBuilderConfiguration class .
For that I created class CustomPackageBuilderConfiguration by extending to
PackageBuilderConfiguration.
after that I wrote the code:
PackageBuilderConfiguration cfg = new CustomPackageBuilderConfiguration();
KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder(cfg);
Now application is running perfectly fine from both eclipse and command
prompt without any exception.
I want to know as my overrided method "setCompiler" was exactly same then
why I had to override method, and In original code (ie in
drools-compiler.jar file) why it was giving exception ??? Was that due
to class lader or something else ?? Please do help in this regard ....
Thanks & Regards:
Pankaj Jain | L&T infotech |Navi Mumbai
Mobile: +91 9920218945
Email : pankaj.jain(a)lntinfotech.com
www.Lntinfotech.com
"Whatever the mind of man can conceive & believe, it can achieve."
Larsen & Toubro Infotech Ltd.
www.Lntinfotech.com
This Document is classified as:
L&T Infotech Proprietary L&T Infotech Confidential L&T Infotech
Internal Use Only L&T Infotech General Business
This Email may contain confidential or privileged information for the
intended recipient (s) If you are not the intended recipient, please do
not use or disseminate the information, notify the sender and delete it
from your system.
______________________________________________________________________
15 years, 5 months
Re: [rules-users] Run Drool Application From Command Prompt
by Greg Barton
Well, there you go. :) Just put drools into the regular classpath and not the bootstrap classpath. Is that possible?
--- On Tue, 7/28/09, Pankaj.Jain(a)lntinfotech.com <Pankaj.Jain(a)lntinfotech.com> wrote:
> From: Pankaj.Jain(a)lntinfotech.com <Pankaj.Jain(a)lntinfotech.com>
> Subject: Re: [rules-users] Run Drool Application From Command Prompt
> To: "Rules Users List" <rules-users(a)lists.jboss.org>
> Date: Tuesday, July 28, 2009, 1:23 AM
>
>
> Hi
>
>
>
> you r right, When I run
> the application
> (integrated with OFBiz) from command prompt I get the
> NPE: in line
>
>
>
> getClass().getClassLoader().loadClass(
> "org.eclipse.jdt.internal.compiler.Compiler"
> );
>
>
>
> When I run the
> application (ofcourse
> integrated with OFBiz) from eclipse I don't get
> NPE exception.
>
>
>
>
>
> In ofbiz we have a batch
> file named
> startofbiz.bat to run the application, inside this I
> configured the classpath
> by this
>
>
>
>
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\antlr-runtime.jar
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\drools-api.jar
> %VMARGS%
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\drools-compiler.jar
> %VMARGS%
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\drools-core.jar
> %VMARGS%
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\drools-decisiontables.jar
> %VMARGS%
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\drools-jsr94.jar
> %VMARGS%
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\drools-templates.jar
> %VMARGS%
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\joda-time.jar
> %VMARGS%
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\jsr94.jar
> %VMARGS%
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\jxl.jar
> %VMARGS%
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\mvel2.jar
> %VMARGS%
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\org.eclipse.jdt.core_3.4.4.v_894_R34x.jar
> %VMARGS%
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\xpp3.jar
> %VMARGS%
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\xpp3_min.jar
> %VMARGS%
>
> set
> VMARGS=-Xbootclasspath/p:applications\order\lib\xstream.jar
> %VMARGS%
>
>
>
>
>
>
>
> If i don't do this I
> get the class
> not found exception
>
>
>
> Thanks & Regards:
>
>
>
> Pankaj Jain | L&T infotech |Navi Mumbai
>
> Mobile: +91 9920218945
>
> Email : pankaj.jain(a)lntinfotech.com
>
> www.Lntinfotech.com
>
>
>
> "Whatever the mind of man can conceive & believe,
> it can achieve."
>
>
>
> Larsen & Toubro Infotech Ltd.
>
> www.Lntinfotech.com
>
>
>
> This Document is classified as:
>
>
>
> L&T
> Infotech Proprietary L&T
> Infotech Confidential L&T
> Infotech Internal Use Only L&T
> Infotech General Business
>
>
>
> This Email may contain confidential or privileged
> information for the intended
> recipient (s) If you are not the intended recipient, please
> do not use
> or disseminate the information, notify the sender and
> delete it from your
> system.
>
>
>
>
>
>
>
>
> Greg
> Barton <greg_barton(a)yahoo.com>
>
>
> Sent by:
> rules-users-bounces(a)lists.jboss.org
> 07/28/2009 11:29
> AM
>
>
>
> Please respond to
>
> Rules Users List
> <rules-users(a)lists.jboss.org>
>
>
>
>
>
>
> To
> Rules Users List
> <rules-users(a)lists.jboss.org>
>
>
> cc
>
>
>
> Subject
> Re: [rules-users]
> Run Drool Application
> >From Command Prompt
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> It's unclear from your post when you get the NPE: from
> the command line,
> from eclipse, or when integrated with OFBiz. (I assume
> you're referring
> to http://ofbiz.apache.org/)
>
>
>
> It's undoubtedly a classpath issue. Just peek at
> the source a bit.
> I'm not sure what version you're using, but
> if you look at the source
> in the svn repo you'll see that line 92 of
> JavaDialectConfiguration is
> this:
>
>
>
> getClass().getClassLoader().loadClass(
> "org.eclipse.jdt.internal.compiler.Compiler"
> );
>
>
>
> See the javadoc for Class.getClassLoader() that says
> "Returns the
> class loader for the class. Some implementations may use
> null to represent
> the bootstrap class loader. This method will return null in
> such implementations
> if this class was loaded by the bootstrap class
> loader."
>
>
>
> So, it looks probable that in the environment that's
> having problems, the
> JavaDialectConfiguration class is loaded by the bootstrap
> classloader.
> What is the VM implementation you're using?
>
>
>
> It might be best if
> Thread.currentThread().getContextClassLoader() was
> used instead of getClass().getClassLoader() in
> JavaDialectConfiguration
> and elsewhere. Devs, have an opinion on that?
>
>
>
> --- On Mon, 7/27/09, Pankaj.Jain(a)lntinfotech.com
> <Pankaj.Jain(a)lntinfotech.com>
> wrote:
>
>
>
> > From: Pankaj.Jain(a)lntinfotech.com
> <Pankaj.Jain(a)lntinfotech.com>
>
> > Subject: Re: [rules-users] Run Drool Application From
> Command Prompt
>
> > To: rules-users(a)lists.jboss.org
>
> > Date: Monday, July 27, 2009, 11:50 PM
>
> >
>
> >
>
> > Hi
>
> >
>
> >
>
> >
>
> > I still have not got any
>
> > solution
>
> > of my problem that I posted previously. I have
> included all
>
> > required jar
>
> > files and set proper class path .. Please do help ?
>
> >
>
> >
>
> >
>
> > problem:
>
> >
>
> >
>
> >
>
> >
>
> > I am trying to
>
> > integrate Drool with
>
> > ofbiz and run application from command prompt. In one
> way I
>
> > have integrated
>
> > it properly and I am able to run it
>
> > successfully.
>
> >
>
> >
>
> >
>
> >
>
> > Code : Which I was using initially
>
> >
>
> >
>
> >
>
> > KnowledgeBuilder kbuilder =
>
> > KnowledgeBuilderFactory.newKnowledgeBuilder();
>
> >
>
> >
>
> >
>
> >
>
> > or
>
> >
>
> >
>
> >
>
> > PackageBuilderConfiguration cfg = new
>
> > PackageBuilderConfiguration();
>
> >
>
> >
>
> > KnowledgeBuilder kbuilder =
>
> > KnowledgeBuilderFactory.newKnowledgeBuilder();
>
> >
>
> >
>
> >
>
> >
>
> > Exception I got :
>
> >
>
> >
>
> >
>
> > org.drools.RuntimeDroolsException: Unable to load
> dialect
>
> >
> 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java
>
> >
>
> >
>
> >
> :org.drools.rule.builder.dialect.java.JavaDialectConfiguration'
>
> >
>
> >
>
> > at
>
> >
> org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:274)
>
> > at
>
> >
> org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:259)
>
> >
>
> >
>
> >
>
> >
>
> > at
>
> >
> org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:176)
>
> > at
>
> >
> org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:153)
>
> > at
>
> >
> org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:242)
>
> >
>
> >
>
> > .
>
> >
>
> > .
>
> >
>
> > .
>
> >
>
> > Caused by: java.lang.NullPointerException
>
> >
>
> > at
>
> >
> org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:92)
>
> > at
>
> >
> org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:55)
>
> > at
>
> >
> org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:270
>
> >
>
> >
>
> >
>
> >
>
> > Problem I found :
>
> >
>
> > In the class JavaDialectConfiguration in jar file
>
> > drools-compiler.jar there
>
> > is a method named "setCompliler", in
> this
>
> > method Null Pointer
>
> > Exception was coming.
>
> >
>
> >
>
> >
>
> > Solution I provided :
>
> >
>
> >
>
> > In my application I created my custom class
>
> > CustomJavaDialectConfiguration
>
> > by extending to class JavaDialectConfiguration, In
> this
>
> > class I overrided
>
> > the method setCompiler. My method was exactly same as
> that
>
> > of method setCompiler
>
> > in JavaDialectConfiguration . To call my dialect class
> I
>
> > also overrided
>
> > the method "addDialect" of
>
> > PackageBuilderConfiguration class
>
> > . For that I created class
>
> > CustomPackageBuilderConfiguration by extending
>
> > to PackageBuilderConfiguration.
>
> >
>
> > after that I wrote the code:
>
> >
>
> >
>
> >
>
> > PackageBuilderConfiguration cfg = new
>
> > CustomPackageBuilderConfiguration();
>
> >
>
> >
>
> > KnowledgeBuilder kbuilder =
>
> > KnowledgeBuilderFactory.newKnowledgeBuilder(cfg);
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > Now application is running perfectly fine from both
> eclipse
>
> > and command
>
> > prompt without any exception.
>
> >
>
> >
>
> >
>
> > I want to know as my overrided method
>
> > "setCompiler" was exactly
>
> > same then why I had to override method, and In
> original
>
> > code (ie in drools-compiler.jar
>
> > file) why it was giving exception ??? Was
> that
>
> > due to class
>
> > lader or something else ?? Please do help in
> this
>
> > regard ....
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > Thanks & Regards:
>
> >
>
> >
>
> >
>
> > Pankaj Jain | L&T infotech |Navi Mumbai
>
> >
>
> > Mobile: +91 9920218945
>
> >
>
> > Email : pankaj.jain(a)lntinfotech.com
>
> >
>
> > www.Lntinfotech.com
>
> >
>
> >
>
> >
>
> > "Whatever the mind of man can conceive &
> believe,
>
> > it can achieve."
>
> >
>
> >
>
> >
>
> > Larsen & Toubro Infotech Ltd.
>
> >
>
> > www.Lntinfotech.com
>
> >
>
> >
>
> >
>
> > This Document is classified as:
>
> >
>
> >
>
> >
>
> > L&T
>
> > Infotech Proprietary L&T
>
> > Infotech Confidential L&T
>
> > Infotech Internal Use Only L&T
>
> > Infotech General Business
>
> >
>
> >
>
> >
>
> > This Email may contain confidential or privileged
>
> > information for the intended
>
> > recipient (s) If you are not the intended recipient,
> please
>
> > do not use
>
> > or disseminate the information, notify the sender and
>
> > delete it from your
>
> > system.
>
> >
>
> >
>
> >
>
> >
> ______________________________________________________________________
>
> >
>
> >
>
> > -----Inline Attachment Follows-----
>
> >
>
> > _______________________________________________
>
> > rules-users mailing list
>
> > rules-users(a)lists.jboss.org
>
> > https://lists.jboss.org/mailman/listinfo/rules-users
>
> >
>
>
>
>
>
>
>
>
>
> _______________________________________________
>
> rules-users mailing list
>
> rules-users(a)lists.jboss.org
>
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
> ______________________________________________________________________
>
>
>
>
>
>
>
> ______________________________________________________________________
>
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
15 years, 5 months
NPE exception in MarshallerReaderContext
by NKeating@decaresystems.ie
Hi,
I'm getting a NPE exception when using drools-persistence-jpa with Drools Flow
(I'm working with the trunk version 28274). It occurs in
MarshallerReaderContext (line 78, see link below) and seems to be a result of
JBRULES-2149. When loading a WorkItemInfo from the database a
MarshallerReaderContext is created without the ruleBase set. For the moment I
have added another catch block for the NPE and call super.resolveClass(desc).
This seems to be working correctly and would have been the behaviour before
JBRULES-2149.
Should I go ahead and create a JIRA issue for this, or what is the prefered way
to get the fixed in the trunk?
http://fisheye.jboss.org/browse/JBossRules/trunk/drools-core/src/main/jav...
http://fisheye.jboss.org/browse/JBossRules/trunk/drools-persistence-jpa/s...
https://jira.jboss.org/jira/browse/JBRULES-2149
Regards,
Noel Keating
Senior Developer
DeCare Systems Ireland
+353 21 492-5188
nkeating(a)decaresystems.ie
blog.decaresystems.ie
This e-mail and any files transmitted with it are intended solely for the individual or entity to whom they are addressed.
This communication may contain material that is privileged, confidential and protected from disclosure under the law.
If you are not the intended recipient, any disclosure, distribution, copying, or use of this information is strictly prohibited and may be unlawful.
If you have received this e-mail in error, please reply immediately to the sender and delete it.
Registered Address:
DeCare Systems Ireland Ltd,
Building 1,
University Technology Centre,
Curraheen Road,
Cork,
Ireland.
Company Registration Number: 278462
15 years, 5 months
guvnor analysis question/error and scenarios
by phil went
Am running drools 5.0.1 ga using the drools/jboss standalone package.
When I run the analysis from within guvnor, no error comes up in guvnor and
it happily lists the models and attribs, but the following comes up in the
server output:
>>
15:06:15,122 ERROR [STDERR] org.drools.RuntimeDroolsException:
org.drools.verifier.opposites.Rule_Opposite_LiteralRestrictions_0Eval1Invoker@90c73ecd:
java.util.zip.DataFormatException: Value types did not match. Value
type
boolean was compared to boolean
15:06:15,123 ERROR [STDERR] at
org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:122)
15:06:15,123 ERROR [STDERR]
>>
The rules all fire as expected, the scenarios all execute, and the rules
file (in guvnor) all validates OK.
Am a complete java noob, so do not know if it is just something obvious I
have missed about boolean defintions?
Also, when the "run all scenarios" is run from within guvnor, scenarios are
not updated in the same way as when the scenario is run individually. eg I
ran the tests individually when setting up, and subsequently only ran all
scenarios in batch. Only found out when I ran an xlst on the scenarios to
show off how cool this stuff is to the managers, showing last run and last
results.
Phil
15 years, 5 months
Re: [rules-users] Run Drool Application From Command Prompt
by Greg Barton
It's unclear from your post when you get the NPE: from the command line, from eclipse, or when integrated with OFBiz. (I assume you're referring to http://ofbiz.apache.org/)
It's undoubtedly a classpath issue. Just peek at the source a bit. I'm not sure what version you're using, but if you look at the source in the svn repo you'll see that line 92 of JavaDialectConfiguration is this:
getClass().getClassLoader().loadClass( "org.eclipse.jdt.internal.compiler.Compiler" );
See the javadoc for Class.getClassLoader() that says "Returns the class loader for the class. Some implementations may use null to represent the bootstrap class loader. This method will return null in such implementations if this class was loaded by the bootstrap class loader."
So, it looks probable that in the environment that's having problems, the JavaDialectConfiguration class is loaded by the bootstrap classloader. What is the VM implementation you're using?
It might be best if Thread.currentThread().getContextClassLoader() was used instead of getClass().getClassLoader() in JavaDialectConfiguration and elsewhere. Devs, have an opinion on that?
--- On Mon, 7/27/09, Pankaj.Jain(a)lntinfotech.com <Pankaj.Jain(a)lntinfotech.com> wrote:
> From: Pankaj.Jain(a)lntinfotech.com <Pankaj.Jain(a)lntinfotech.com>
> Subject: Re: [rules-users] Run Drool Application From Command Prompt
> To: rules-users(a)lists.jboss.org
> Date: Monday, July 27, 2009, 11:50 PM
>
>
> Hi
>
>
>
> I still have not got any
> solution
> of my problem that I posted previously. I have included all
> required jar
> files and set proper class path .. Please do help ?
>
>
>
> problem:
>
>
>
>
> I am trying to
> integrate Drool with
> ofbiz and run application from command prompt. In one way I
> have integrated
> it properly and I am able to run it
> successfully.
>
>
>
>
> Code : Which I was using initially
>
>
>
> KnowledgeBuilder kbuilder =
> KnowledgeBuilderFactory.newKnowledgeBuilder();
>
>
>
>
> or
>
>
>
> PackageBuilderConfiguration cfg = new
> PackageBuilderConfiguration();
>
>
> KnowledgeBuilder kbuilder =
> KnowledgeBuilderFactory.newKnowledgeBuilder();
>
>
>
>
> Exception I got :
>
>
>
> org.drools.RuntimeDroolsException: Unable to load dialect
> 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java
>
>
> :org.drools.rule.builder.dialect.java.JavaDialectConfiguration'
>
>
> at
> org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:274)
> at
> org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:259)
>
>
>
>
> at
> org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:176)
> at
> org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:153)
> at
> org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:242)
>
>
> .
>
> .
>
> .
>
> Caused by: java.lang.NullPointerException
>
> at
> org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:92)
> at
> org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:55)
> at
> org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:270
>
>
>
>
> Problem I found :
>
> In the class JavaDialectConfiguration in jar file
> drools-compiler.jar there
> is a method named "setCompliler", in this
> method Null Pointer
> Exception was coming.
>
>
>
> Solution I provided :
>
>
> In my application I created my custom class
> CustomJavaDialectConfiguration
> by extending to class JavaDialectConfiguration, In this
> class I overrided
> the method setCompiler. My method was exactly same as that
> of method setCompiler
> in JavaDialectConfiguration . To call my dialect class I
> also overrided
> the method "addDialect" of
> PackageBuilderConfiguration class
> . For that I created class
> CustomPackageBuilderConfiguration by extending
> to PackageBuilderConfiguration.
>
> after that I wrote the code:
>
>
>
> PackageBuilderConfiguration cfg = new
> CustomPackageBuilderConfiguration();
>
>
> KnowledgeBuilder kbuilder =
> KnowledgeBuilderFactory.newKnowledgeBuilder(cfg);
>
>
>
>
>
>
> Now application is running perfectly fine from both eclipse
> and command
> prompt without any exception.
>
>
>
> I want to know as my overrided method
> "setCompiler" was exactly
> same then why I had to override method, and In original
> code (ie in drools-compiler.jar
> file) why it was giving exception ??? Was that
> due to class
> lader or something else ?? Please do help in this
> regard ....
>
>
>
>
>
>
>
>
> Thanks & Regards:
>
>
>
> Pankaj Jain | L&T infotech |Navi Mumbai
>
> Mobile: +91 9920218945
>
> Email : pankaj.jain(a)lntinfotech.com
>
> www.Lntinfotech.com
>
>
>
> "Whatever the mind of man can conceive & believe,
> it can achieve."
>
>
>
> Larsen & Toubro Infotech Ltd.
>
> www.Lntinfotech.com
>
>
>
> This Document is classified as:
>
>
>
> L&T
> Infotech Proprietary L&T
> Infotech Confidential L&T
> Infotech Internal Use Only L&T
> Infotech General Business
>
>
>
> This Email may contain confidential or privileged
> information for the intended
> recipient (s) If you are not the intended recipient, please
> do not use
> or disseminate the information, notify the sender and
> delete it from your
> system.
>
>
>
> ______________________________________________________________________
>
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
15 years, 5 months
Re: [rules-users] Run Drool Application From Command Prompt
by Greg Barton
heh. I just remembered that Thread.currentThread().getContextClassLoader() can return null as well. :) A good thing to do is have a utility function like the attached class loading utility class. Rearrange the class loading order to suit your taste.
--- On Tue, 7/28/09, Greg Barton <greg_barton(a)yahoo.com> wrote:
> From: Greg Barton <greg_barton(a)yahoo.com>
> Subject: Re: [rules-users] Run Drool Application From Command Prompt
> To: "Rules Users List" <rules-users(a)lists.jboss.org>
> Date: Tuesday, July 28, 2009, 12:59 AM
>
> It's unclear from your post when you get the NPE: from the
> command line, from eclipse, or when integrated with OFBiz.
> (I assume you're referring to http://ofbiz.apache.org/)
>
> It's undoubtedly a classpath issue. Just peek at the
> source a bit. I'm not sure what version you're using,
> but if you look at the source in the svn repo you'll see
> that line 92 of JavaDialectConfiguration is this:
>
> getClass().getClassLoader().loadClass(
> "org.eclipse.jdt.internal.compiler.Compiler" );
>
> See the javadoc for Class.getClassLoader() that says
> "Returns the class loader for the class. Some
> implementations may use null to represent the bootstrap
> class loader. This method will return null in such
> implementations if this class was loaded by the bootstrap
> class loader."
>
> So, it looks probable that in the environment that's having
> problems, the JavaDialectConfiguration class is loaded by
> the bootstrap classloader. What is the VM
> implementation you're using?
>
> It might be best if
> Thread.currentThread().getContextClassLoader() was used
> instead of getClass().getClassLoader() in
> JavaDialectConfiguration and elsewhere. Devs, have an
> opinion on that?
>
> --- On Mon, 7/27/09, Pankaj.Jain(a)lntinfotech.com
> <Pankaj.Jain(a)lntinfotech.com>
> wrote:
>
> > From: Pankaj.Jain(a)lntinfotech.com
> <Pankaj.Jain(a)lntinfotech.com>
> > Subject: Re: [rules-users] Run Drool Application From
> Command Prompt
> > To: rules-users(a)lists.jboss.org
> > Date: Monday, July 27, 2009, 11:50 PM
> >
> >
> > Hi
> >
> >
> >
> > I still have not got any
> > solution
> > of my problem that I posted previously. I have
> included all
> > required jar
> > files and set proper class path .. Please do help ?
> >
> >
> >
> > problem:
> >
> >
> >
> >
> > I am trying to
> > integrate Drool with
> > ofbiz and run application from command prompt. In one
> way I
> > have integrated
> > it properly and I am able to run it
> > successfully.
> >
> >
> >
> >
> > Code : Which I was using initially
> >
> >
> >
> > KnowledgeBuilder kbuilder =
> > KnowledgeBuilderFactory.newKnowledgeBuilder();
> >
> >
> >
> >
> > or
> >
> >
> >
> > PackageBuilderConfiguration cfg = new
> > PackageBuilderConfiguration();
> >
> >
> > KnowledgeBuilder kbuilder =
> > KnowledgeBuilderFactory.newKnowledgeBuilder();
> >
> >
> >
> >
> > Exception I got :
> >
> >
> >
> > org.drools.RuntimeDroolsException: Unable to load
> dialect
> >
> 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java
> >
> >
> >
> :org.drools.rule.builder.dialect.java.JavaDialectConfiguration'
> >
> >
> > at
> >
> org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:274)
> > at
> >
> org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:259)
> >
> >
> >
> >
> > at
> >
> org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:176)
> > at
> >
> org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:153)
> > at
> >
> org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:242)
> >
> >
> > .
> >
> > .
> >
> > .
> >
> > Caused by: java.lang.NullPointerException
> >
> > at
> >
> org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:92)
> > at
> >
> org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:55)
> > at
> >
> org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:270
> >
> >
> >
> >
> > Problem I found :
> >
> > In the class JavaDialectConfiguration in jar file
> > drools-compiler.jar there
> > is a method named "setCompliler", in this
> > method Null Pointer
> > Exception was coming.
> >
> >
> >
> > Solution I provided :
> >
> >
> > In my application I created my custom class
> > CustomJavaDialectConfiguration
> > by extending to class JavaDialectConfiguration, In
> this
> > class I overrided
> > the method setCompiler. My method was exactly same as
> that
> > of method setCompiler
> > in JavaDialectConfiguration . To call my dialect class
> I
> > also overrided
> > the method "addDialect" of
> > PackageBuilderConfiguration class
> > . For that I created class
> > CustomPackageBuilderConfiguration by extending
> > to PackageBuilderConfiguration.
> >
> > after that I wrote the code:
> >
> >
> >
> > PackageBuilderConfiguration cfg = new
> > CustomPackageBuilderConfiguration();
> >
> >
> > KnowledgeBuilder kbuilder =
> > KnowledgeBuilderFactory.newKnowledgeBuilder(cfg);
> >
> >
> >
> >
> >
> >
> > Now application is running perfectly fine from both
> eclipse
> > and command
> > prompt without any exception.
> >
> >
> >
> > I want to know as my overrided method
> > "setCompiler" was exactly
> > same then why I had to override method, and In
> original
> > code (ie in drools-compiler.jar
> > file) why it was giving exception ??? Was that
> > due to class
> > lader or something else ?? Please do help in this
> > regard ....
> >
> >
> >
> >
> >
> >
> >
> >
> > Thanks & Regards:
> >
> >
> >
> > Pankaj Jain | L&T infotech |Navi Mumbai
> >
> > Mobile: +91 9920218945
> >
> > Email : pankaj.jain(a)lntinfotech.com
> >
> > www.Lntinfotech.com
> >
> >
> >
> > "Whatever the mind of man can conceive & believe,
> > it can achieve."
> >
> >
> >
> > Larsen & Toubro Infotech Ltd.
> >
> > www.Lntinfotech.com
> >
> >
> >
> > This Document is classified as:
> >
> >
> >
> > L&T
> > Infotech Proprietary L&T
> > Infotech Confidential L&T
> > Infotech Internal Use Only L&T
> > Infotech General Business
> >
> >
> >
> > This Email may contain confidential or privileged
> > information for the intended
> > recipient (s) If you are not the intended recipient,
> please
> > do not use
> > or disseminate the information, notify the sender and
> > delete it from your
> > system.
> >
> >
> >
> >
> ______________________________________________________________________
> >
> >
> > -----Inline Attachment Follows-----
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
15 years, 5 months
Drools Guvnor Remote API
by Steve Ronderos
Does anyone know if there is a Remoting API in Guvnor? I see mention of it
in some wiki pages, and in the web.xml in the Guvnor source.
I'm trying to see if I can remotely trigger a build for a specific
package, with a selector for the build, then create a snapshot for the
same package.
If anyone has any information about the API please let me know.
Thanks,
Steve Ronderos
15 years, 5 months
question on adding manual workitem within flow editor
by Pang, Yonghua
Hi,
I'm a newbie of Drools and I just met a problem when learning Drools
Flow according to Drools online documents.
I create a workitem, Notification, exactly according to Chapter 8 in
Drools Flow Doc. I create MyWorkDefinitions.conf and
drools.rulebase.conf, and then put them in classpath. Also, I create one
image to be used by the item.
However, this new workitem is not found in RuleFlow Editor. I'm not
sure if something else is needed. Can you guys please guide me to adding
new workitem and dragging/drawing it in RuleFlow Editor?
FYI. Though the RuleFlow editor cannot work with the new workitem, the
XML style works. I mean, I could manually change the XML of .rf file to
use the new workitem.
The work environment is JDK5, Drools5, Eclipse 3.4.5 and GEF 3.5.
The two conf files are also attached.
<<drools.rulebase.conf>> <<MyWorkDefinitions.conf>>
Thanks,
Paul
15 years, 5 months