Re: [rules-users] Fresh Guvnor Install throws ClassNotFoundException

2012-01-10 Thread Michael Anstis
Guvnor doesn't use OSGi.

The stack trace suggests the JAR you are has a dependency on OSGi:-

org.drools.guvnor.server.contenthandler.ModelContentHandler.getImportsFromJar.

The remainder of the stack trace relates to trying to load the imported
class.

2012/1/9 Mike Key mi...@zenbitz.com

 Hi all,

 I have installed Guvnor 5.3.0-Final on a fresh Tomcat 7.0.12.  I am able
 to import existing rules I have, however when I try to upload my fact model
 I get an error in the localhost log file:

 SEVERE: Servlet.service() for servlet [AssetFileServlet] in context with
 path [/guvnor-5.3.0.Final-tomcat-6.0] threw exception [Servlet execution
 threw an exception] with root cause
 java.lang.ClassNotFoundException: org.osgi.framework.BundleActivator
 ...at
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
 ...at
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
 ...at java.lang.Class.forName0(Native Method)
 ...at java.lang.Class.forName(Class.java:247)
 ...at
 org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:109)
 ...at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 ...at java.lang.ClassLoader.defineClass1(Native Method)
 ...at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
 ...at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
 ...at
 org.drools.rule.MapBackedClassLoader.fastFindClass(MapBackedClassLoader.java:86)
 ...at
 org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:104)
 ...at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 ...at
 org.drools.guvnor.server.contenthandler.ModelContentHandler.isClassVisible(ModelContentHandler.java:183)
 ...at
 org.drools.guvnor.server.contenthandler.ModelContentHandler.getImportsFromJar(ModelContentHandler.java:148)
 ...at
 org.drools.guvnor.server.contenthandler.ModelContentHandler.onAttachmentAdded(ModelContentHandler.java:66)
 ...at
 org.drools.guvnor.server.files.FileManagerUtils.attachFileToAsset(FileManagerUtils.java:115)
 ...at
 org.drools.guvnor.server.files.FileManagerUtils.attachFile(FileManagerUtils.java:87)
 ...at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 ...at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 ...at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 ...at java.lang.reflect.Method.invoke(Method.java:597)
 ...at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
 ...at
 org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
 ...at
 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
 ...at
 org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
 ...at
 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 ...at
 org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
 ...at
 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 ...at
 org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
 ...at
 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 ...at
 org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163)
 ...at
 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 ...at
 org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
 ...at
 org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
 ...at
 org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)

 I am attempting to upload a jar with all dependencies it uses (which
 includes JPA annotations and JAXB annotations).  I have verified that the
 jar contains all its proper dependencies.  This message seems to indicate I
 am missing some OSGi jar or something that I would have expected to be
 delivered with Guvnor.  Do I need some sort of global libraries for OSGi to
 run Guvnor or to use my model when it has these external dependencies in
 the jar?

 Any help on this is greatly appreciated.

 Cheers.

 Mike Key

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Template Key in DSL

2012-01-10 Thread Wolfgang Laun
Hi Frank,

thanks for your follow-up.

As much as I like source code generators, I must confess that I've come to
dislike the generation of many almost identical chunks, e.g., varying only
in literals.

This means that using templates without an if in the available macro
language is a weak tool. Consequently, this triple layering isn't on my
tops list.

Basically, I agree with your assessment, the only caveat being the level of
complexity and extend that is convenient to achieve with a DSL.

Regards
Wolfgang


On 9 January 2012 17:08, FrankVhh frank.vanhoensho...@agserv.eu wrote:

 Hi,

 Sorry to have kept you waiting.

 If you use plain DRL, you have 1 source of information. If you use DSL, you
 add an extra source of information by inserting the data in it. Adding DSL
 on top of that, adds a third source of information in the form of a
 vocabulary.

 In theory, the more disperse your information, the more difficult it will
 be
 to maintain.

 Until now, I debugged all templates in the same way. Expand them all
 completely and have them outputted to a real DRL file. Than, debug the
 outputted file and make corrections in your template accordingly. Here,
 imho, there is not much difference in a DSLR template and a DRL template,
 provided that you have a stable DSL. This is not a debugging method that I
 particullary like, but it gets the job done.

 If you assess the difference between a DSLR and a DRL template, the only
 differentiator is the DSL. In that case it comes down to the question
 whether you have a stable DSL or not. If your DSL is mature, I would prefer
 DSLR over DRL for reasons of understandability to non-technical users.
 Unless your template is meant to be hidden from the user.

 Regards,
 Frank


 laune wrote
 
  OK, thanks for the confirmation.
 
  Do you have any comments w.r.t. to usability during development
  (debugging?!) and maintenance? The example is simple enough, but what's
  your feeling?
 
  -W
 
  On 6 January 2012 08:46, FrankVhh lt;frank.vanhoenshoven@gt; wrote:
 
 
  laune wrote
  
   What I suggested is a non-standard way of rule authoring, and I just
  think
   that it is possible - I've never tried it.
  
 
  This should work. I tried it once with Drools 5.0, so I assume it is
  still
  OK.
 
  http://drools.46999.n3.nabble.com/file/n3637269/voc.dsl voc.dsl
  http://drools.46999.n3.nabble.com/file/n3637269/Sample.dst Sample.dst
  http://drools.46999.n3.nabble.com/file/n3637269/DroolsTest.java
  DroolsTest.java
 
  --
  View this message in context:
 
 http://drools.46999.n3.nabble.com/Template-Key-in-DSL-tp3634710p3637269.html
  Sent from the Drools: User forum mailing list archive at Nabble.com.
  ___
  rules-users mailing list
  rules-users@.jboss
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
  ___
  rules-users mailing list
  rules-users@.jboss
  https://lists.jboss.org/mailman/listinfo/rules-users
 


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Template-Key-in-DSL-tp3634710p3644953.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Template Key in DSL

2012-01-10 Thread Michael Anstis
I still think, in my opinion, it is worthwhile adding the ability to define
Template Keys in DSL in Guvnor.

A simple (contrived and incomplete example) DSL might be:-

[when] There is an insurance policy quote=$p : PolicyQuote( )
[when] Number of previous claims on policy is between {min} and
{max}=ClaimHistory( quote == $p, numberOfClaims = {min}, numberOfClaims 
{max} )
[then] Set insurance premium load factor to {loadFactor} =
$p.setLoadFactor( {loadFactor} );

A user might like to define rules using DSL for the following data set:-

0 = claims  1, load = 0
1 = claims  3, load = 10%
3 = claims  5, load = 15%
etc.

This can be accomplished with a Template or Decision Table using DRL terms
but as yet, in Guvnor, not DSL.

Obviously it can be achieved from a developers perspective using Drools
Expert as demonstrated.

With kind regards,

Mike

2012/1/10 Wolfgang Laun wolfgang.l...@gmail.com

 Hi Frank,

 thanks for your follow-up.

 As much as I like source code generators, I must confess that I've come to
 dislike the generation of many almost identical chunks, e.g., varying only
 in literals.

 This means that using templates without an if in the available macro
 language is a weak tool. Consequently, this triple layering isn't on my
 tops list.

 Basically, I agree with your assessment, the only caveat being the level
 of complexity and extend that is convenient to achieve with a DSL.

 Regards
 Wolfgang



 On 9 January 2012 17:08, FrankVhh frank.vanhoensho...@agserv.eu wrote:

 Hi,

 Sorry to have kept you waiting.

 If you use plain DRL, you have 1 source of information. If you use DSL,
 you
 add an extra source of information by inserting the data in it. Adding DSL
 on top of that, adds a third source of information in the form of a
 vocabulary.

 In theory, the more disperse your information, the more difficult it will
 be
 to maintain.

 Until now, I debugged all templates in the same way. Expand them all
 completely and have them outputted to a real DRL file. Than, debug the
 outputted file and make corrections in your template accordingly. Here,
 imho, there is not much difference in a DSLR template and a DRL template,
 provided that you have a stable DSL. This is not a debugging method that I
 particullary like, but it gets the job done.

 If you assess the difference between a DSLR and a DRL template, the only
 differentiator is the DSL. In that case it comes down to the question
 whether you have a stable DSL or not. If your DSL is mature, I would
 prefer
 DSLR over DRL for reasons of understandability to non-technical users.
 Unless your template is meant to be hidden from the user.

 Regards,
 Frank


 laune wrote
 
  OK, thanks for the confirmation.
 
  Do you have any comments w.r.t. to usability during development
  (debugging?!) and maintenance? The example is simple enough, but what's
  your feeling?
 
  -W
 
  On 6 January 2012 08:46, FrankVhh lt;frank.vanhoenshoven@gt; wrote:
 
 
  laune wrote
  
   What I suggested is a non-standard way of rule authoring, and I just
  think
   that it is possible - I've never tried it.
  
 
  This should work. I tried it once with Drools 5.0, so I assume it is
  still
  OK.
 
  http://drools.46999.n3.nabble.com/file/n3637269/voc.dsl voc.dsl
  http://drools.46999.n3.nabble.com/file/n3637269/Sample.dst Sample.dst
  http://drools.46999.n3.nabble.com/file/n3637269/DroolsTest.java
  DroolsTest.java
 
  --
  View this message in context:
 
 http://drools.46999.n3.nabble.com/Template-Key-in-DSL-tp3634710p3637269.html
  Sent from the Drools: User forum mailing list archive at Nabble.com.
  ___
  rules-users mailing list
  rules-users@.jboss
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
  ___
  rules-users mailing list
  rules-users@.jboss
  https://lists.jboss.org/mailman/listinfo/rules-users
 


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Template-Key-in-DSL-tp3634710p3644953.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users



 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Template Key in DSL

2012-01-10 Thread FrankVhh
Hi,


laune wrote
 
 As much as I like source code generators, I must confess that I've come to
 dislike the generation of many almost identical chunks, e.g., varying only
 in literals.
 

Imho, that would be a case to put in a decision table.


laune wrote
 
 This means that using templates without an if in the available macro
 language is a weak tool. Consequently, this triple layering isn't on my
 tops list.
 

You are probably right with this. Templates should probably be considered as
a tool that allows you to generate quite complex rules with only minor
coding. Of course, the more coding the more rigid (and less agile) the
solution will become. 

Actually, this will split your data in two separate layers, the original
data and the transformed data and will burden you with the overhead of the
transformation code. However, there might be a valuable trade-off in going
for this approach.

Regards,
Frank


laune wrote
 
 Hi Frank,
 
 thanks for your follow-up.
 
 As much as I like source code generators, I must confess that I've come to
 dislike the generation of many almost identical chunks, e.g., varying only
 in literals.
 
 This means that using templates without an if in the available macro
 language is a weak tool. Consequently, this triple layering isn't on my
 tops list.
 
 Basically, I agree with your assessment, the only caveat being the level
 of
 complexity and extend that is convenient to achieve with a DSL.
 
 Regards
 Wolfgang
 


--
View this message in context: 
http://drools.46999.n3.nabble.com/Template-Key-in-DSL-tp3634710p3647236.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Gwt Console in JBPM

2012-01-10 Thread srinivasasanda
Hi,

I'm using JBPM5.1 installer,with JBOSS 5.1.0GA,Drools 5.3

I'm integrating Drools with JBPM.Before that,this is issue arised with
JBPM5.I've dowloaded the source code for jbpm console in
*https://github.com/bpmc/bpm-console*.I followed instructions and succesfuly
made 2 war files gwt-console.war,gwt-console-server.war.

But,When I'm deploying them in my JBOSS,it is generating exception and I'm
unable to open the console.The server log is
2012-01-10 12:47:17,303 INFO 
[org.jboss.web.tomcat.service.deployers.TomcatDeployment] (main) deploy,
ctxPath=/default-bpm-console
2012-01-10 12:47:18,156 ERROR [org.reflections.Reflections] (main) could not
create Vfs.Dir from url. ignoring the exception and continuing
org.reflections.ReflectionsException: could not create Dir using
org.jboss.errai.bus.server.service.metadata.VFSUrlType from url
vfszip:/D:/jbpm-installer/jboss-5.1.0.GA/server/default/deploy/gwt-console.war/WEB-INF/classes/..

When I'm opening http://localhost:8080/jbpm-console:It is generating 404
page not found error.Please suggest me how to achieve it.Even I posted in
other forums,but couldnt able to get solution.Could you please suggest me

--
View this message in context: 
http://drools.46999.n3.nabble.com/Gwt-Console-in-JBPM-tp3647313p3647313.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] MVEL curly braces position - bug or feature?

2012-01-10 Thread Wolfgang Laun
You can create the same effect using
   while(...)
   {}
or
   do
  {} while( ... );
or
   for(;;)
   {}

You can't do  it with switch(){} because that's not accepted at all.

-W

2012/1/6 Edson Tirelli ed.tire...@gmail.com


Looks like a bug. MVEL does ; injection in order to make ; optional, so
 my guess is that it is mistakenly injecting ; after your modify() call and
 handling {} as a separate code block.

Edson


 On Fri, Jan 6, 2012 at 11:51 AM, nickS nsand...@msxi-euro.com wrote:

 Hi

 I've been learning drools ands I saw that there is a Fibonacci example,
 so I
 thought I'd write my own using mvel as the dialect and then compare it to
 the model solution.

 However, I couldn't get mine working. It parsed but the behaviour was very
 odd. It kept ignoring the modify block in my recurse rule and consequently
 it went into an infinite loop. I compared it to the 'approved' solution
 and
 the two were pretty much the same, except that it worked and mine didn't.

 After a lot of checking I noticed that I had started my curly brace on a
 new
 line after modify but the example had continued straight after the closing
 brace of the modify.

 Works //

 modify ( f ){
value = 1
   };

 or

  modify ( f ){value = 1 };


 Doesn't Work //

 modify ( f )
 {
  value = 1
  };


 Does anyone know if this is a bug or a feature?


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/MVEL-curly-braces-position-bug-or-feature-tp3638341p3638341.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




 --
   Edson Tirelli
   JBoss Drools Core Development
   JBoss by Red Hat @ www.jboss.com

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Unable to execute BPMN2.0 process in Eclipse

2012-01-10 Thread Manohar Kokkula
  
 Hi All, Now I appoached other way, I am using Drool-5.2.0 final, Guvnor 5.2.0 final and designer-2.0-jboss.war in Drools-Guvnor.In
 Designer, I created simple process and copied into eclipse through Guvnor repository.
When I am trying executed this bpmn2.0 process in Eclipse, I got following exceptions:
  
java.lang.IllegalArgumentException: Unknown process ID: javaprocess
 at org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1635)
 at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:306)
 at com.simple.ProcessTest.main(ProcessTest.java:45)
  
I am also sending my code :
  
  
package com.simple;
  
import java.util.Iterator;
  
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
import org.drools.agent.KnowledgeAgent;
import org.drools.agent.KnowledgeAgentFactory;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderError;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.definition.KnowledgePackage;
import org.drools.io.Resource;
import org.drools.io.ResourceFactory;
import org.drools.io.impl.ClassPathResource;
import org.drools.rule.FactType;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.process.ProcessInstance;
import org.hibernate.mapping.Collection;
  
public class ProcessTest {
  
 /**
 * @param args
 */
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  
 
  try
  {
   KnowledgeBase kbase=readBase();
   StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
   ksession.startProcess("javaprocess", null);
   ksession.dispose(); 
  }
  catch(Throwable t)
  {
   
   t.printStackTrace();
   
   
  }
  
 }
 private static KnowledgeBase readBase()
 {
  
  KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
  kbuilder.add(new ClassPathResource("Process2.bpmn"), ResourceType.BPMN2);
  //kbuilder.add(new ClassPathResource("Validation.drl"), ResourceType.DRL);
  
 if (kbuilder.hasErrors()){
   for (KnowledgeBuilderError error : kbuilder.getErrors()) {
   System.out.println(error);
   }
   throw new IllegalStateException("Error building kbase!");
  }
  
  KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
  kbase.addKnowledgePackages(kbuilder.getKnowledgePackages()); 
 return kbase;
  
   
 }
  
}
  
  
I tried alot but not getting how to do this.
It will be really helpful if somebody could guide me.
  
  

  Thanks and regards,Manohar KokkulaMailto: manohar.kokk...@tcs.com=-=-=Notice: The information contained in this e-mailmessage and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] CPU Spike creating a StatefulKnowledgeSession using OSGi

2012-01-10 Thread Barry Knapp
I've seen similar issues and addressed it by overriding
ChainedProperties.getResources with a map to hold the enumeration once it is
found rather than constantly going back to the classloader-


MapString, Enumerationlt;URL resourceMap = new TreeMapString,
Enumerationlt;URL();
private EnumerationURL getResources(String name, ClassLoader 
classLoader)
{

if (resourceMap.containsKey(name)) {
return resourceMap.get(name);
}
EnumerationURL enumeration = null;
try {
enumeration = classLoader.getResources(name);
} catch (IOException e) {
e.printStackTrace();
}
resourceMap.put(name, enumeration);
return enumeration;

}

--
View this message in context: 
http://drools.46999.n3.nabble.com/CPU-Spike-creating-a-StatefulKnowledgeSession-using-OSGi-tp1053579p3647726.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] rule flow in BRMS

2012-01-10 Thread kachaps4u
I tried to upload the rule flow(.rf) which i created in IDE inside BRMS. But
its blank in the editor?? any advise will be helpful. thank you.

--
View this message in context: 
http://drools.46999.n3.nabble.com/rule-flow-in-BRMS-tp3647810p3647810.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Executing a subset of rules.

2012-01-10 Thread Stephen Masters
Hi folks,I'm curious on what would be best practice with regards configuring things so that only a subset of rules is evaluated in certain situations.I have a knowledge base that is designed to evaluate a whole variety of rules relating to whether a trade can be carried out. I would like to generate a 'report' of what banks I can trade with based on their current ratings. i.e. Based on rules like "Do not place funds in a counterparty (bank) below Moodys A2 rating." However there are numerous other rules such as "Do not place more than 20% of a fund in a single currency".To generate the report I was going to set up a batch of dummy trades for evaluation and 'ask' the rules engine whether I am allowed to trade. However, specifically for the purposes of this report I don't want to see failures caused by anything other than a counterparty ratings rule.I was thinking that one option would be to organise my packages so that I have an isolated 'counterparty ratings' package. That way I could load that specific set of rules into a counterparty ratings reporting session, and not others.Does that seem a reasonable way of doing things? Or are there better ways of doing this?Thanks in advance for any thoughts...SteveStephen Mastershttp://about.me/stephen-masters
stephen.mast...@me.com___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Fresh Guvnor Install throws ClassNotFoundException

2012-01-10 Thread Mike Key
Thanks for the response Michael.  I did get past the error by adding an
OSGi jar to tomcat's libs.  The curious thing is that I'm loading a jar
from a maven build (actually an assembly with all dependencies added to the
jar).  The jar itself does not have this class, and if I do a mvn
dependency:tree I never see OSGi mentioned in any dependencies or
transitive dependencies of my entire source tree.

At this point it may not be a question for this list, but I did try the
same thing using JBoss AS 7 and the issue does not exist there.  Does
anyone happen to know if perhaps how guvnor is asking tomcat to load the
classes may be what is requiring OSGi?  Not sure how the tomcat 7 class
loader works.

Like I said I realize this is not really a Drools or Guvnor question at
this point, but hopefully someone on the list may know?

Thanks again for the response.

Mike

2012/1/10 Michael Anstis michael.ans...@gmail.com

 Guvnor doesn't use OSGi.

 The stack trace suggests the JAR you are has a dependency on OSGi:-


 org.drools.guvnor.server.contenthandler.ModelContentHandler.getImportsFromJar.

 The remainder of the stack trace relates to trying to load the imported
 class.

 2012/1/9 Mike Key mi...@zenbitz.com

 Hi all,

 I have installed Guvnor 5.3.0-Final on a fresh Tomcat 7.0.12.  I am able
 to import existing rules I have, however when I try to upload my fact model
 I get an error in the localhost log file:

 SEVERE: Servlet.service() for servlet [AssetFileServlet] in context with
 path [/guvnor-5.3.0.Final-tomcat-6.0] threw exception [Servlet execution
 threw an exception] with root cause
 java.lang.ClassNotFoundException: org.osgi.framework.BundleActivator
 ...at
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
 ...at
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
 ...at java.lang.Class.forName0(Native Method)
 ...at java.lang.Class.forName(Class.java:247)
 ...at
 org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:109)
 ...at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 ...at java.lang.ClassLoader.defineClass1(Native Method)
 ...at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
 ...at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
 ...at
 org.drools.rule.MapBackedClassLoader.fastFindClass(MapBackedClassLoader.java:86)
 ...at
 org.drools.rule.MapBackedClassLoader.loadClass(MapBackedClassLoader.java:104)
 ...at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 ...at
 org.drools.guvnor.server.contenthandler.ModelContentHandler.isClassVisible(ModelContentHandler.java:183)
 ...at
 org.drools.guvnor.server.contenthandler.ModelContentHandler.getImportsFromJar(ModelContentHandler.java:148)
 ...at
 org.drools.guvnor.server.contenthandler.ModelContentHandler.onAttachmentAdded(ModelContentHandler.java:66)
 ...at
 org.drools.guvnor.server.files.FileManagerUtils.attachFileToAsset(FileManagerUtils.java:115)
 ...at
 org.drools.guvnor.server.files.FileManagerUtils.attachFile(FileManagerUtils.java:87)
 ...at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 ...at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 ...at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 ...at java.lang.reflect.Method.invoke(Method.java:597)
 ...at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
 ...at
 org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
 ...at
 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
 ...at
 org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
 ...at
 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 ...at
 org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
 ...at
 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 ...at
 org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
 ...at
 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 ...at
 org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163)
 ...at
 org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
 ...at
 org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
 ...at
 org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
 ...at
 org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)

 I am attempting to upload a jar with all dependencies it uses (which
 includes JPA annotations and JAXB annotations).  I have verified that the
 jar contains all its proper dependencies.  This message seems to indicate I
 am missing some OSGi jar or something that I would have expected to be
 delivered with Guvnor.  Do I need some 

Re: [rules-users] NullPointerException when load file rules

2012-01-10 Thread jjmartinez
Anybody can help me? I don't know why my application show these errors.

Thanks in advance!

--
View this message in context: 
http://drools.46999.n3.nabble.com/NullPointerException-when-load-file-rules-tp3645021p3648159.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] NullPointerException when load file rules

2012-01-10 Thread Swindells, Thomas
Looking at the stack trace, if you are on the same version as drools as me it 
looks like it is this line
this.rule.setDialect( getDialect().getId() );

The most likely reason is your DRL isn't valid - perhaps where you are 
specifying the dialect, or it could be your
Dependencies aren't right or something.
Which version of drools are you using. Have you tried reducing your DRL file to 
the minimum that generates the error - then post that DRL if you need further 
help.

Thomas

 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
 boun...@lists.jboss.org] On Behalf Of jjmartinez
 Sent: 10 January 2012 17:05
 To: rules-users@lists.jboss.org
 Subject: Re: [rules-users] NullPointerException when load file rules

 Anybody can help me? I don't know why my application show these errors.

 Thanks in advance!

 java.lang.NullPointerException
at 
org.drools.rule.builder.RuleBuildContext.init(RuleBuildContext.java:88)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1149)
at 
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:636)
at 
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:266)
at 
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:458)
at 
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at drools.ejemplos.DroolsTest.readKnowledgeBase(DroolsTest.java:85)
at drools.ejemplos.DroolsTest.execute(DroolsTest.java:64)
at drools.ejemplos.DroolsTest.init(DroolsTest.java:56)
at drools.ejemplos.Activator.start(Activator.java:14)
at org.knopflerfish.framework.BundleImpl.start0(BundleImpl.java:356)
at org.knopflerfish.framework.BundleThread.run(BundleThread.java:107)


**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
postmas...@nds.com and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] NullPointerException when load file rules

2012-01-10 Thread elMateo
I'm using Drools 5.4.0 Beta 1 and my DRL is the Hello World of Drools :)
(all my application is the Hello World of Drools, because I'm trying to do
a OSGi bundle with this application).

In my OSGi framework is running drools.core, drools.compiler and
knowledge-api, and others bundles.

Thanks for reply me.

On Tue, Jan 10, 2012 at 6:15 PM, Swindells, Thomas tswinde...@nds.comwrote:

 Looking at the stack trace, if you are on the same version as drools as me
 it looks like it is this line
 this.rule.setDialect( getDialect().getId() );

 The most likely reason is your DRL isn't valid - perhaps where you are
 specifying the dialect, or it could be your
 Dependencies aren't right or something.
 Which version of drools are you using. Have you tried reducing your DRL
 file to the minimum that generates the error - then post that DRL if you
 need further help.

 Thomas

  -Original Message-
  From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
  boun...@lists.jboss.org] On Behalf Of jjmartinez
  Sent: 10 January 2012 17:05
  To: rules-users@lists.jboss.org
  Subject: Re: [rules-users] NullPointerException when load file rules
 
  Anybody can help me? I don't know why my application show these errors.
 
  Thanks in advance!
 
  java.lang.NullPointerException
at
 org.drools.rule.builder.RuleBuildContext.init(RuleBuildContext.java:88)
at
 org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1149)
at
 org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:636)
at
 org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:266)
at
 org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:458)
at
 org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at drools.ejemplos.DroolsTest.readKnowledgeBase(DroolsTest.java:85)
at drools.ejemplos.DroolsTest.execute(DroolsTest.java:64)
at drools.ejemplos.DroolsTest.init(DroolsTest.java:56)
at drools.ejemplos.Activator.start(Activator.java:14)
at org.knopflerfish.framework.BundleImpl.start0(BundleImpl.java:356)
at
 org.knopflerfish.framework.BundleThread.run(BundleThread.java:107)



 **
 This message is confidential and intended only for the addressee. If you
 have received this message in error, please immediately notify the
 postmas...@nds.com and delete it from your system as well as any copies.
 The content of e-mails as well as traffic data may be monitored by NDS for
 employment and security purposes. To protect the environment please do not
 print this e-mail unless necessary.

 NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18
 4EX, United Kingdom. A company registered in England and Wales. Registered
 no. 3080780. VAT no. GB 603 8808 40-00

 **

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] NullPointerException when load file rules

2012-01-10 Thread elMateo
Hi Mauricio,

I'm going to test this.

Thank you so much!!

On Tue, Jan 10, 2012 at 6:35 PM, Mauricio Salatino sala...@gmail.comwrote:

 Oh.. I see what is happening here.. the Default dialects and session
 configurations are not being loaded by your OSGI environment :)
 It took me a while to find that out so I hope this comment helps you
 to save some valuable time.
 Solution: you need to add inside your project that is loading the
 rules the following file:
 META-INF/drools.packagebuilder.conf

 That contains the following content:
 drools.dialect.default = java
 drools.dialect.java =
 org.drools.rule.builder.dialect.java.JavaDialectConfiguration
 drools.dialect.java.compiler = ECLIPSE

 drools.dialect.mvel =
 org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration
 drools.dialect.mvel.strict = true
 drools.dialect.mvel.langLevel = 4

 drools.accumulate.function.average =
 org.drools.base.accumulators.AverageAccumulateFunction
 drools.accumulate.function.max =
 org.drools.base.accumulators.MaxAccumulateFunction
 drools.accumulate.function.min =
 org.drools.base.accumulators.MinAccumulateFunction
 drools.accumulate.function.count =
 org.drools.base.accumulators.CountAccumulateFunction
 drools.accumulate.function.sum =
 org.drools.base.accumulators.SumAccumulateFunction
 drools.accumulate.function.collectList =
 org.drools.base.accumulators.CollectListAccumulateFunction
 drools.accumulate.function.collectSet =
 org.drools.base.accumulators.CollectSetAccumulateFunction

 drools.evaluator.coincides =
 org.drools.base.evaluators.CoincidesEvaluatorDefinition
 drools.evaluator.before =
 org.drools.base.evaluators.BeforeEvaluatorDefinition
 drools.evaluator.after =
 org.drools.base.evaluators.AfterEvaluatorDefinition
 drools.evaluator.meets =
 org.drools.base.evaluators.MeetsEvaluatorDefinition
 drools.evaluator.metby =
 org.drools.base.evaluators.MetByEvaluatorDefinition
 drools.evaluator.overlaps =
 org.drools.base.evaluators.OverlapsEvaluatorDefinition
 drools.evaluator.overlappedby =
 org.drools.base.evaluators.OverlappedByEvaluatorDefinition
 drools.evaluator.during =
 org.drools.base.evaluators.DuringEvaluatorDefinition
 drools.evaluator.includes =
 org.drools.base.evaluators.IncludesEvaluatorDefinition
 drools.evaluator.starts =
 org.drools.base.evaluators.StartsEvaluatorDefinition
 drools.evaluator.startedby =
 org.drools.base.evaluators.StartedByEvaluatorDefinition
 drools.evaluator.finishes =
 org.drools.base.evaluators.FinishesEvaluatorDefinition
 drools.evaluator.finishedby =
 org.drools.base.evaluators.FinishedByEvaluatorDefinition
 drools.evaluator.equality =
 org.drools.base.evaluators.EqualityEvaluatorsDefinition
 drools.evaluator.comparable =
 org.drools.base.evaluators.ComparableEvaluatorsDefinition
 drools.evaluator.set = org.drools.base.evaluators.SetEvaluatorsDefinition
 drools.evaluator.matches =
 org.drools.base.evaluators.MatchesEvaluatorsDefinition
 drools.evaluator.soundslike =
 org.drools.base.evaluators.SoundslikeEvaluatorsDefinition

 That is provided by drools-compiler.jar or drools-core.jar (I don't
 have the code here) but it's not being picked up by the OSGI
 container.

 Cheers


 2012/1/10 elMateo soyelma...@gmail.com:
  I'm using Drools 5.4.0 Beta 1 and my DRL is the Hello World of Drools :)
  (all my application is the Hello World of Drools, because I'm trying to
 do a
  OSGi bundle with this application).
 
  In my OSGi framework is running drools.core, drools.compiler and
  knowledge-api, and others bundles.
 
  Thanks for reply me.
 
  On Tue, Jan 10, 2012 at 6:15 PM, Swindells, Thomas tswinde...@nds.com
  wrote:
 
  Looking at the stack trace, if you are on the same version as drools as
 me
  it looks like it is this line
  this.rule.setDialect( getDialect().getId() );
 
  The most likely reason is your DRL isn't valid - perhaps where you are
  specifying the dialect, or it could be your
  Dependencies aren't right or something.
  Which version of drools are you using. Have you tried reducing your DRL
  file to the minimum that generates the error - then post that DRL if you
  need further help.
 
  Thomas
 
   -Original Message-
   From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
   boun...@lists.jboss.org] On Behalf Of jjmartinez
   Sent: 10 January 2012 17:05
   To: rules-users@lists.jboss.org
   Subject: Re: [rules-users] NullPointerException when load file rules
  
   Anybody can help me? I don't know why my application show these
 errors.
  
   Thanks in advance!
  
   java.lang.NullPointerException
 at
 
 org.drools.rule.builder.RuleBuildContext.init(RuleBuildContext.java:88)
 at
  org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1149)
 at
  org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:636)
 at
 
 org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:266)
 at
 
 org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:458)
   

Re: [rules-users] NullPointerException when load file rules

2012-01-10 Thread Mauricio Salatino
If it works we can prove that most of the OSGI containers works in the
same way :)

2012/1/10 elMateo soyelma...@gmail.com:
 Hi Mauricio,

 I'm going to test this.

 Thank you so much!!

 On Tue, Jan 10, 2012 at 6:35 PM, Mauricio Salatino sala...@gmail.com
 wrote:

 Oh.. I see what is happening here.. the Default dialects and session
 configurations are not being loaded by your OSGI environment :)
 It took me a while to find that out so I hope this comment helps you
 to save some valuable time.
 Solution: you need to add inside your project that is loading the
 rules the following file:
 META-INF/drools.packagebuilder.conf

 That contains the following content:
 drools.dialect.default = java
 drools.dialect.java =
 org.drools.rule.builder.dialect.java.JavaDialectConfiguration
 drools.dialect.java.compiler = ECLIPSE

 drools.dialect.mvel =
 org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration
 drools.dialect.mvel.strict = true
 drools.dialect.mvel.langLevel = 4

 drools.accumulate.function.average =
 org.drools.base.accumulators.AverageAccumulateFunction
 drools.accumulate.function.max =
 org.drools.base.accumulators.MaxAccumulateFunction
 drools.accumulate.function.min =
 org.drools.base.accumulators.MinAccumulateFunction
 drools.accumulate.function.count =
 org.drools.base.accumulators.CountAccumulateFunction
 drools.accumulate.function.sum =
 org.drools.base.accumulators.SumAccumulateFunction
 drools.accumulate.function.collectList =
 org.drools.base.accumulators.CollectListAccumulateFunction
 drools.accumulate.function.collectSet =
 org.drools.base.accumulators.CollectSetAccumulateFunction

 drools.evaluator.coincides =
 org.drools.base.evaluators.CoincidesEvaluatorDefinition
 drools.evaluator.before =
 org.drools.base.evaluators.BeforeEvaluatorDefinition
 drools.evaluator.after =
 org.drools.base.evaluators.AfterEvaluatorDefinition
 drools.evaluator.meets =
 org.drools.base.evaluators.MeetsEvaluatorDefinition
 drools.evaluator.metby =
 org.drools.base.evaluators.MetByEvaluatorDefinition
 drools.evaluator.overlaps =
 org.drools.base.evaluators.OverlapsEvaluatorDefinition
 drools.evaluator.overlappedby =
 org.drools.base.evaluators.OverlappedByEvaluatorDefinition
 drools.evaluator.during =
 org.drools.base.evaluators.DuringEvaluatorDefinition
 drools.evaluator.includes =
 org.drools.base.evaluators.IncludesEvaluatorDefinition
 drools.evaluator.starts =
 org.drools.base.evaluators.StartsEvaluatorDefinition
 drools.evaluator.startedby =
 org.drools.base.evaluators.StartedByEvaluatorDefinition
 drools.evaluator.finishes =
 org.drools.base.evaluators.FinishesEvaluatorDefinition
 drools.evaluator.finishedby =
 org.drools.base.evaluators.FinishedByEvaluatorDefinition
 drools.evaluator.equality =
 org.drools.base.evaluators.EqualityEvaluatorsDefinition
 drools.evaluator.comparable =
 org.drools.base.evaluators.ComparableEvaluatorsDefinition
 drools.evaluator.set = org.drools.base.evaluators.SetEvaluatorsDefinition
 drools.evaluator.matches =
 org.drools.base.evaluators.MatchesEvaluatorsDefinition
 drools.evaluator.soundslike =
 org.drools.base.evaluators.SoundslikeEvaluatorsDefinition

 That is provided by drools-compiler.jar or drools-core.jar (I don't
 have the code here) but it's not being picked up by the OSGI
 container.

 Cheers


 2012/1/10 elMateo soyelma...@gmail.com:
  I'm using Drools 5.4.0 Beta 1 and my DRL is the Hello World of Drools :)
  (all my application is the Hello World of Drools, because I'm trying to
  do a
  OSGi bundle with this application).
 
  In my OSGi framework is running drools.core, drools.compiler and
  knowledge-api, and others bundles.
 
  Thanks for reply me.
 
  On Tue, Jan 10, 2012 at 6:15 PM, Swindells, Thomas tswinde...@nds.com
  wrote:
 
  Looking at the stack trace, if you are on the same version as drools as
  me
  it looks like it is this line
  this.rule.setDialect( getDialect().getId() );
 
  The most likely reason is your DRL isn't valid - perhaps where you are
  specifying the dialect, or it could be your
  Dependencies aren't right or something.
  Which version of drools are you using. Have you tried reducing your DRL
  file to the minimum that generates the error - then post that DRL if
  you
  need further help.
 
  Thomas
 
   -Original Message-
   From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
   boun...@lists.jboss.org] On Behalf Of jjmartinez
   Sent: 10 January 2012 17:05
   To: rules-users@lists.jboss.org
   Subject: Re: [rules-users] NullPointerException when load file rules
  
   Anybody can help me? I don't know why my application show these
   errors.
  
   Thanks in advance!
  
   java.lang.NullPointerException
         at
 
  org.drools.rule.builder.RuleBuildContext.init(RuleBuildContext.java:88)
         at
  org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1149)
         at
  org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:636)
         at
 
  

Re: [rules-users] NullPointerException when load file rules

2012-01-10 Thread elMateo
Now, this is the trace: (it's different to the other)

org.drools.RuntimeDroolsException: Unable to load dialect ':mvel:null'
[stderr] at
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:283)
[stderr] at
org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:268)
[stderr] at
org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:181)
[stderr] at
org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:159)
[stderr] at
org.drools.compiler.PackageBuilder.init(PackageBuilder.java:210)
[stderr] at
org.drools.compiler.PackageBuilder.init(PackageBuilder.java:143)
[stderr] at
org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl.newKnowledgeBuilder(KnowledgeBuilderFactoryServiceImpl.java:34)
[stderr] at
org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:47)
[stderr] at drools.ejemplos.DroolsTest.readKnowledgeBase(DroolsTest.java:94)
[stderr] at drools.ejemplos.DroolsTest.execute(DroolsTest.java:68)
[stderr] at drools.ejemplos.DroolsTest.init(DroolsTest.java:60)
[stderr] at drools.ejemplos.Activator.start(Activator.java:14)
[stderr] at
org.knopflerfish.framework.BundleImpl.start0(BundleImpl.java:356)
[stderr] at
org.knopflerfish.framework.BundleThread.run(BundleThread.java:107)
[stderr] Caused by: java.lang.NullPointerException
[stderr] at
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:278)
[stderr] ... 13 more

On Tue, Jan 10, 2012 at 6:46 PM, Mauricio Salatino sala...@gmail.comwrote:

 If it works we can prove that most of the OSGI containers works in the
 same way :)

 2012/1/10 elMateo soyelma...@gmail.com:
  Hi Mauricio,
 
  I'm going to test this.
 
  Thank you so much!!
 
  On Tue, Jan 10, 2012 at 6:35 PM, Mauricio Salatino sala...@gmail.com
  wrote:
 
  Oh.. I see what is happening here.. the Default dialects and session
  configurations are not being loaded by your OSGI environment :)
  It took me a while to find that out so I hope this comment helps you
  to save some valuable time.
  Solution: you need to add inside your project that is loading the
  rules the following file:
  META-INF/drools.packagebuilder.conf
 
  That contains the following content:
  drools.dialect.default = java
  drools.dialect.java =
  org.drools.rule.builder.dialect.java.JavaDialectConfiguration
  drools.dialect.java.compiler = ECLIPSE
 
  drools.dialect.mvel =
  org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration
  drools.dialect.mvel.strict = true
  drools.dialect.mvel.langLevel = 4
 
  drools.accumulate.function.average =
  org.drools.base.accumulators.AverageAccumulateFunction
  drools.accumulate.function.max =
  org.drools.base.accumulators.MaxAccumulateFunction
  drools.accumulate.function.min =
  org.drools.base.accumulators.MinAccumulateFunction
  drools.accumulate.function.count =
  org.drools.base.accumulators.CountAccumulateFunction
  drools.accumulate.function.sum =
  org.drools.base.accumulators.SumAccumulateFunction
  drools.accumulate.function.collectList =
  org.drools.base.accumulators.CollectListAccumulateFunction
  drools.accumulate.function.collectSet =
  org.drools.base.accumulators.CollectSetAccumulateFunction
 
  drools.evaluator.coincides =
  org.drools.base.evaluators.CoincidesEvaluatorDefinition
  drools.evaluator.before =
  org.drools.base.evaluators.BeforeEvaluatorDefinition
  drools.evaluator.after =
  org.drools.base.evaluators.AfterEvaluatorDefinition
  drools.evaluator.meets =
  org.drools.base.evaluators.MeetsEvaluatorDefinition
  drools.evaluator.metby =
  org.drools.base.evaluators.MetByEvaluatorDefinition
  drools.evaluator.overlaps =
  org.drools.base.evaluators.OverlapsEvaluatorDefinition
  drools.evaluator.overlappedby =
  org.drools.base.evaluators.OverlappedByEvaluatorDefinition
  drools.evaluator.during =
  org.drools.base.evaluators.DuringEvaluatorDefinition
  drools.evaluator.includes =
  org.drools.base.evaluators.IncludesEvaluatorDefinition
  drools.evaluator.starts =
  org.drools.base.evaluators.StartsEvaluatorDefinition
  drools.evaluator.startedby =
  org.drools.base.evaluators.StartedByEvaluatorDefinition
  drools.evaluator.finishes =
  org.drools.base.evaluators.FinishesEvaluatorDefinition
  drools.evaluator.finishedby =
  org.drools.base.evaluators.FinishedByEvaluatorDefinition
  drools.evaluator.equality =
  org.drools.base.evaluators.EqualityEvaluatorsDefinition
  drools.evaluator.comparable =
  org.drools.base.evaluators.ComparableEvaluatorsDefinition
  drools.evaluator.set =
 org.drools.base.evaluators.SetEvaluatorsDefinition
  drools.evaluator.matches =
  org.drools.base.evaluators.MatchesEvaluatorsDefinition
  drools.evaluator.soundslike =
  org.drools.base.evaluators.SoundslikeEvaluatorsDefinition
 
  That is provided by drools-compiler.jar or drools-core.jar (I don't
  have the code here) but it's not being picked 

Re: [rules-users] NullPointerException when load file rules

2012-01-10 Thread Mauricio Salatino
Do you have the mvel2 bundle in your class path?
Did you add the file that I mention inside the META-INF dir inside your app?

Cheers.

2012/1/10 elMateo soyelma...@gmail.com:
 Now, this is the trace: (it's different to the other)

 org.drools.RuntimeDroolsException: Unable to load dialect ':mvel:null'
 [stderr] at
 org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:283)
 [stderr] at
 org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:268)
 [stderr] at
 org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:181)
 [stderr] at
 org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:159)
 [stderr] at
 org.drools.compiler.PackageBuilder.init(PackageBuilder.java:210)
 [stderr] at
 org.drools.compiler.PackageBuilder.init(PackageBuilder.java:143)
 [stderr] at
 org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl.newKnowledgeBuilder(KnowledgeBuilderFactoryServiceImpl.java:34)
 [stderr] at
 org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:47)
 [stderr] at drools.ejemplos.DroolsTest.readKnowledgeBase(DroolsTest.java:94)
 [stderr] at drools.ejemplos.DroolsTest.execute(DroolsTest.java:68)
 [stderr] at drools.ejemplos.DroolsTest.init(DroolsTest.java:60)
 [stderr] at drools.ejemplos.Activator.start(Activator.java:14)
 [stderr] at
 org.knopflerfish.framework.BundleImpl.start0(BundleImpl.java:356)
 [stderr] at
 org.knopflerfish.framework.BundleThread.run(BundleThread.java:107)
 [stderr] Caused by: java.lang.NullPointerException
 [stderr] at
 org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:278)
 [stderr] ... 13 more

 On Tue, Jan 10, 2012 at 6:46 PM, Mauricio Salatino sala...@gmail.com
 wrote:

 If it works we can prove that most of the OSGI containers works in the
 same way :)

 2012/1/10 elMateo soyelma...@gmail.com:
  Hi Mauricio,
 
  I'm going to test this.
 
  Thank you so much!!
 
  On Tue, Jan 10, 2012 at 6:35 PM, Mauricio Salatino sala...@gmail.com
  wrote:
 
  Oh.. I see what is happening here.. the Default dialects and session
  configurations are not being loaded by your OSGI environment :)
  It took me a while to find that out so I hope this comment helps you
  to save some valuable time.
  Solution: you need to add inside your project that is loading the
  rules the following file:
  META-INF/drools.packagebuilder.conf
 
  That contains the following content:
  drools.dialect.default = java
  drools.dialect.java =
  org.drools.rule.builder.dialect.java.JavaDialectConfiguration
  drools.dialect.java.compiler = ECLIPSE
 
  drools.dialect.mvel =
  org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration
  drools.dialect.mvel.strict = true
  drools.dialect.mvel.langLevel = 4
 
  drools.accumulate.function.average =
  org.drools.base.accumulators.AverageAccumulateFunction
  drools.accumulate.function.max =
  org.drools.base.accumulators.MaxAccumulateFunction
  drools.accumulate.function.min =
  org.drools.base.accumulators.MinAccumulateFunction
  drools.accumulate.function.count =
  org.drools.base.accumulators.CountAccumulateFunction
  drools.accumulate.function.sum =
  org.drools.base.accumulators.SumAccumulateFunction
  drools.accumulate.function.collectList =
  org.drools.base.accumulators.CollectListAccumulateFunction
  drools.accumulate.function.collectSet =
  org.drools.base.accumulators.CollectSetAccumulateFunction
 
  drools.evaluator.coincides =
  org.drools.base.evaluators.CoincidesEvaluatorDefinition
  drools.evaluator.before =
  org.drools.base.evaluators.BeforeEvaluatorDefinition
  drools.evaluator.after =
  org.drools.base.evaluators.AfterEvaluatorDefinition
  drools.evaluator.meets =
  org.drools.base.evaluators.MeetsEvaluatorDefinition
  drools.evaluator.metby =
  org.drools.base.evaluators.MetByEvaluatorDefinition
  drools.evaluator.overlaps =
  org.drools.base.evaluators.OverlapsEvaluatorDefinition
  drools.evaluator.overlappedby =
  org.drools.base.evaluators.OverlappedByEvaluatorDefinition
  drools.evaluator.during =
  org.drools.base.evaluators.DuringEvaluatorDefinition
  drools.evaluator.includes =
  org.drools.base.evaluators.IncludesEvaluatorDefinition
  drools.evaluator.starts =
  org.drools.base.evaluators.StartsEvaluatorDefinition
  drools.evaluator.startedby =
  org.drools.base.evaluators.StartedByEvaluatorDefinition
  drools.evaluator.finishes =
  org.drools.base.evaluators.FinishesEvaluatorDefinition
  drools.evaluator.finishedby =
  org.drools.base.evaluators.FinishedByEvaluatorDefinition
  drools.evaluator.equality =
  org.drools.base.evaluators.EqualityEvaluatorsDefinition
  drools.evaluator.comparable =
  org.drools.base.evaluators.ComparableEvaluatorsDefinition
  drools.evaluator.set =
  org.drools.base.evaluators.SetEvaluatorsDefinition
  drools.evaluator.matches =
  org.drools.base.evaluators.MatchesEvaluatorsDefinition
  

Re: [rules-users] NullPointerException when load file rules

2012-01-10 Thread elMateo
Yes, mvel2 is a bundle in my framework and I add this file in META-INF.

I find drools.packagebuilder.conf in droos-compiler, and I copy this to my
META-INF dir.

And it works!!  Aleluya

On Tue, Jan 10, 2012 at 6:50 PM, Mauricio Salatino sala...@gmail.comwrote:

 Do you have the mvel2 bundle in your class path?
 Did you add the file that I mention inside the META-INF dir inside your
 app?

 Cheers.

 2012/1/10 elMateo soyelma...@gmail.com:
  Now, this is the trace: (it's different to the other)
 
  org.drools.RuntimeDroolsException: Unable to load dialect ':mvel:null'
  [stderr] at
 
 org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:283)
  [stderr] at
 
 org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:268)
  [stderr] at
 
 org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:181)
  [stderr] at
 
 org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:159)
  [stderr] at
  org.drools.compiler.PackageBuilder.init(PackageBuilder.java:210)
  [stderr] at
  org.drools.compiler.PackageBuilder.init(PackageBuilder.java:143)
  [stderr] at
 
 org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl.newKnowledgeBuilder(KnowledgeBuilderFactoryServiceImpl.java:34)
  [stderr] at
 
 org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:47)
  [stderr] at
 drools.ejemplos.DroolsTest.readKnowledgeBase(DroolsTest.java:94)
  [stderr] at drools.ejemplos.DroolsTest.execute(DroolsTest.java:68)
  [stderr] at drools.ejemplos.DroolsTest.init(DroolsTest.java:60)
  [stderr] at drools.ejemplos.Activator.start(Activator.java:14)
  [stderr] at
  org.knopflerfish.framework.BundleImpl.start0(BundleImpl.java:356)
  [stderr] at
  org.knopflerfish.framework.BundleThread.run(BundleThread.java:107)
  [stderr] Caused by: java.lang.NullPointerException
  [stderr] at
 
 org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:278)
  [stderr] ... 13 more
 
  On Tue, Jan 10, 2012 at 6:46 PM, Mauricio Salatino sala...@gmail.com
  wrote:
 
  If it works we can prove that most of the OSGI containers works in the
  same way :)
 
  2012/1/10 elMateo soyelma...@gmail.com:
   Hi Mauricio,
  
   I'm going to test this.
  
   Thank you so much!!
  
   On Tue, Jan 10, 2012 at 6:35 PM, Mauricio Salatino sala...@gmail.com
 
   wrote:
  
   Oh.. I see what is happening here.. the Default dialects and session
   configurations are not being loaded by your OSGI environment :)
   It took me a while to find that out so I hope this comment helps you
   to save some valuable time.
   Solution: you need to add inside your project that is loading the
   rules the following file:
   META-INF/drools.packagebuilder.conf
  
   That contains the following content:
   drools.dialect.default = java
   drools.dialect.java =
   org.drools.rule.builder.dialect.java.JavaDialectConfiguration
   drools.dialect.java.compiler = ECLIPSE
  
   drools.dialect.mvel =
   org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration
   drools.dialect.mvel.strict = true
   drools.dialect.mvel.langLevel = 4
  
   drools.accumulate.function.average =
   org.drools.base.accumulators.AverageAccumulateFunction
   drools.accumulate.function.max =
   org.drools.base.accumulators.MaxAccumulateFunction
   drools.accumulate.function.min =
   org.drools.base.accumulators.MinAccumulateFunction
   drools.accumulate.function.count =
   org.drools.base.accumulators.CountAccumulateFunction
   drools.accumulate.function.sum =
   org.drools.base.accumulators.SumAccumulateFunction
   drools.accumulate.function.collectList =
   org.drools.base.accumulators.CollectListAccumulateFunction
   drools.accumulate.function.collectSet =
   org.drools.base.accumulators.CollectSetAccumulateFunction
  
   drools.evaluator.coincides =
   org.drools.base.evaluators.CoincidesEvaluatorDefinition
   drools.evaluator.before =
   org.drools.base.evaluators.BeforeEvaluatorDefinition
   drools.evaluator.after =
   org.drools.base.evaluators.AfterEvaluatorDefinition
   drools.evaluator.meets =
   org.drools.base.evaluators.MeetsEvaluatorDefinition
   drools.evaluator.metby =
   org.drools.base.evaluators.MetByEvaluatorDefinition
   drools.evaluator.overlaps =
   org.drools.base.evaluators.OverlapsEvaluatorDefinition
   drools.evaluator.overlappedby =
   org.drools.base.evaluators.OverlappedByEvaluatorDefinition
   drools.evaluator.during =
   org.drools.base.evaluators.DuringEvaluatorDefinition
   drools.evaluator.includes =
   org.drools.base.evaluators.IncludesEvaluatorDefinition
   drools.evaluator.starts =
   org.drools.base.evaluators.StartsEvaluatorDefinition
   drools.evaluator.startedby =
   org.drools.base.evaluators.StartedByEvaluatorDefinition
   drools.evaluator.finishes =
   org.drools.base.evaluators.FinishesEvaluatorDefinition
   drools.evaluator.finishedby =
   

Re: [rules-users] NullPointerException when load file rules

2012-01-10 Thread Mauricio Salatino
:) It took me almost two days following bad leads.. We definitely need
to improve how those configurations are loaded by default.. and if
they are not there we should not have an NPE.
Cheers

2012/1/10 elMateo soyelma...@gmail.com:
 Yes, mvel2 is a bundle in my framework and I add this file in META-INF.

 I find drools.packagebuilder.conf in droos-compiler, and I copy this to my
 META-INF dir.

 And it works!!  Aleluya


 On Tue, Jan 10, 2012 at 6:50 PM, Mauricio Salatino sala...@gmail.com
 wrote:

 Do you have the mvel2 bundle in your class path?
 Did you add the file that I mention inside the META-INF dir inside your
 app?

 Cheers.

 2012/1/10 elMateo soyelma...@gmail.com:
  Now, this is the trace: (it's different to the other)
 
  org.drools.RuntimeDroolsException: Unable to load dialect ':mvel:null'
  [stderr] at
 
  org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:283)
  [stderr] at
 
  org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:268)
  [stderr] at
 
  org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:181)
  [stderr] at
 
  org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:159)
  [stderr] at
  org.drools.compiler.PackageBuilder.init(PackageBuilder.java:210)
  [stderr] at
  org.drools.compiler.PackageBuilder.init(PackageBuilder.java:143)
  [stderr] at
 
  org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl.newKnowledgeBuilder(KnowledgeBuilderFactoryServiceImpl.java:34)
  [stderr] at
 
  org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:47)
  [stderr] at
  drools.ejemplos.DroolsTest.readKnowledgeBase(DroolsTest.java:94)
  [stderr] at drools.ejemplos.DroolsTest.execute(DroolsTest.java:68)
  [stderr] at drools.ejemplos.DroolsTest.init(DroolsTest.java:60)
  [stderr] at drools.ejemplos.Activator.start(Activator.java:14)
  [stderr] at
  org.knopflerfish.framework.BundleImpl.start0(BundleImpl.java:356)
  [stderr] at
  org.knopflerfish.framework.BundleThread.run(BundleThread.java:107)
  [stderr] Caused by: java.lang.NullPointerException
  [stderr] at
 
  org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:278)
  [stderr] ... 13 more
 
  On Tue, Jan 10, 2012 at 6:46 PM, Mauricio Salatino sala...@gmail.com
  wrote:
 
  If it works we can prove that most of the OSGI containers works in the
  same way :)
 
  2012/1/10 elMateo soyelma...@gmail.com:
   Hi Mauricio,
  
   I'm going to test this.
  
   Thank you so much!!
  
   On Tue, Jan 10, 2012 at 6:35 PM, Mauricio Salatino
   sala...@gmail.com
   wrote:
  
   Oh.. I see what is happening here.. the Default dialects and session
   configurations are not being loaded by your OSGI environment :)
   It took me a while to find that out so I hope this comment helps you
   to save some valuable time.
   Solution: you need to add inside your project that is loading the
   rules the following file:
   META-INF/drools.packagebuilder.conf
  
   That contains the following content:
   drools.dialect.default = java
   drools.dialect.java =
   org.drools.rule.builder.dialect.java.JavaDialectConfiguration
   drools.dialect.java.compiler = ECLIPSE
  
   drools.dialect.mvel =
   org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration
   drools.dialect.mvel.strict = true
   drools.dialect.mvel.langLevel = 4
  
   drools.accumulate.function.average =
   org.drools.base.accumulators.AverageAccumulateFunction
   drools.accumulate.function.max =
   org.drools.base.accumulators.MaxAccumulateFunction
   drools.accumulate.function.min =
   org.drools.base.accumulators.MinAccumulateFunction
   drools.accumulate.function.count =
   org.drools.base.accumulators.CountAccumulateFunction
   drools.accumulate.function.sum =
   org.drools.base.accumulators.SumAccumulateFunction
   drools.accumulate.function.collectList =
   org.drools.base.accumulators.CollectListAccumulateFunction
   drools.accumulate.function.collectSet =
   org.drools.base.accumulators.CollectSetAccumulateFunction
  
   drools.evaluator.coincides =
   org.drools.base.evaluators.CoincidesEvaluatorDefinition
   drools.evaluator.before =
   org.drools.base.evaluators.BeforeEvaluatorDefinition
   drools.evaluator.after =
   org.drools.base.evaluators.AfterEvaluatorDefinition
   drools.evaluator.meets =
   org.drools.base.evaluators.MeetsEvaluatorDefinition
   drools.evaluator.metby =
   org.drools.base.evaluators.MetByEvaluatorDefinition
   drools.evaluator.overlaps =
   org.drools.base.evaluators.OverlapsEvaluatorDefinition
   drools.evaluator.overlappedby =
   org.drools.base.evaluators.OverlappedByEvaluatorDefinition
   drools.evaluator.during =
   org.drools.base.evaluators.DuringEvaluatorDefinition
   drools.evaluator.includes =
   org.drools.base.evaluators.IncludesEvaluatorDefinition
   drools.evaluator.starts =
   

[rules-users] For loop inside a modify block problem

2012-01-10 Thread Martin A
Hello, guys,

I have the following snippet of a right side rule:


modify ($gsc) {
doSomething($item.id);

for (int i = 0; i  $item.quantity; i++) {
doSomethingElse($item.id);
}
}

which looks like is invalid syntax in some way, but it comes out with
strange error report, such as '[Error: no such identifier: $item]'

Would you please assist me on how to put that loop inside that modify block?

Thank you and regards,
Martin
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Mauricio Salatino
You just need to do the loop outside the modify block and then just
update the object.
Cheers

2012/1/10 Martin A wml...@gmail.com:
 Hello, guys,

 I have the following snippet of a right side rule:


         modify ($gsc) {
             doSomething($item.id);

             for (int i = 0; i  $item.quantity; i++) {
                 doSomethingElse($item.id);
             }
         }

 which looks like is invalid syntax in some way, but it comes out with
 strange error report, such as '[Error: no such identifier: $item]'

 Would you please assist me on how to put that loop inside that modify block?

 Thank you and regards,
 Martin

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino Salaboy Mauricio -

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Wolfgang Laun
No can do, because within a modify block a comma-separated list of (setter)
method calls of the object between the parentheses must be written.

Note that you can change a fact (without a modify statement) - just follow
this with an update call.

See the Expert manual for details.

-W


2012/1/10 Martin A wml...@gmail.com

 Hello, guys,

 I have the following snippet of a right side rule:


 modify ($gsc) {
 doSomething($item.id);

 for (int i = 0; i  $item.quantity; i++) {
 doSomethingElse($item.id);
 }
 }

 which looks like is invalid syntax in some way, but it comes out with
 strange error report, such as '[Error: no such identifier: $item]'

 Would you please assist me on how to put that loop inside that modify
 block?

 Thank you and regards,
 Martin

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Martin A
Hello,

I suppose that means something like:

modify ($gsc) {
doSomething($item.id);
}


for (int i = 0; i  $item.quantity; i++) {
   $gsc.doSomethingElse($item.id);
}

update($gsc);

Thanks,
Martin

2012/1/10 Wolfgang Laun wolfgang.l...@gmail.com

 No can do, because within a modify block a comma-separated list of
 (setter) method calls of the object between the parentheses must be written.

 Note that you can change a fact (without a modify statement) - just follow
 this with an update call.

 See the Expert manual for details.

 -W


 2012/1/10 Martin A wml...@gmail.com

 Hello, guys,

 I have the following snippet of a right side rule:


 modify ($gsc) {
 doSomething($item.id);

 for (int i = 0; i  $item.quantity; i++) {
 doSomethingElse($item.id);
 }
 }

 which looks like is invalid syntax in some way, but it comes out with
 strange error report, such as '[Error: no such identifier: $item]'

 Would you please assist me on how to put that loop inside that modify
 block?

 Thank you and regards,
 Martin

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users



 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Mauricio Salatino
yeah.. sort of..
you can do

$gsc.doSomething($item.id);
  for (int i = 0; i  $item.quantity; i++) {
            $gsc.doSomethingElse($item.id);
  }
update($gsc);

but by the way.. that loop is not doing anything ..


2012/1/10 Martin A wml...@gmail.com:
 Hello,

 I suppose that means something like:

         modify ($gsc) {
             doSomething($item.id);
         }


         for (int i = 0; i  $item.quantity; i++) {
            $gsc.doSomethingElse($item.id);
         }

         update($gsc);

 Thanks,
 Martin

 2012/1/10 Wolfgang Laun wolfgang.l...@gmail.com

 No can do, because within a modify block a comma-separated list of
 (setter) method calls of the object between the parentheses must be written.

 Note that you can change a fact (without a modify statement) - just follow
 this with an update call.

 See the Expert manual for details.

 -W


 2012/1/10 Martin A wml...@gmail.com

 Hello, guys,

 I have the following snippet of a right side rule:


         modify ($gsc) {
             doSomething($item.id);

             for (int i = 0; i  $item.quantity; i++) {
                 doSomethingElse($item.id);
             }
         }

 which looks like is invalid syntax in some way, but it comes out with
 strange error report, such as '[Error: no such identifier: $item]'

 Would you please assist me on how to put that loop inside that modify
 block?

 Thank you and regards,
 Martin

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users



 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users



 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino Salaboy Mauricio -

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Martin A
Hi, Mauricio,

Thanks for the help.. but what do you mean by '  that loop is not doing
anything  '

Regards,
Martin

On Tue, Jan 10, 2012 at 8:59 PM, Mauricio Salatino sala...@gmail.comwrote:

 yeah.. sort of..
 you can do

 $gsc.doSomething($item.id);
   for (int i = 0; i  $item.quantity; i++) {
 $gsc.doSomethingElse($item.id);
   }
 update($gsc);

 but by the way.. that loop is not doing anything ..


 2012/1/10 Martin A wml...@gmail.com:
  Hello,
 
  I suppose that means something like:
 
  modify ($gsc) {
  doSomething($item.id);
  }
 
 
  for (int i = 0; i  $item.quantity; i++) {
 $gsc.doSomethingElse($item.id);
  }
 
  update($gsc);
 
  Thanks,
  Martin
 
  2012/1/10 Wolfgang Laun wolfgang.l...@gmail.com
 
  No can do, because within a modify block a comma-separated list of
  (setter) method calls of the object between the parentheses must be
 written.
 
  Note that you can change a fact (without a modify statement) - just
 follow
  this with an update call.
 
  See the Expert manual for details.
 
  -W
 
 
  2012/1/10 Martin A wml...@gmail.com
 
  Hello, guys,
 
  I have the following snippet of a right side rule:
 
 
  modify ($gsc) {
  doSomething($item.id);
 
  for (int i = 0; i  $item.quantity; i++) {
  doSomethingElse($item.id);
  }
  }
 
  which looks like is invalid syntax in some way, but it comes out with
  strange error report, such as '[Error: no such identifier: $item]'
 
  Would you please assist me on how to put that loop inside that modify
  block?
 
  Thank you and regards,
  Martin
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 



 --
  - CTO @ http://www.plugtree.com
  - MyJourney @ http://salaboy.wordpress.com
  - Co-Founder @ http://www.jugargentina.org
  - Co-Founder @ http://www.jbug.com.ar

  - Salatino Salaboy Mauricio -

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Martin A
Strangely, after making the changes, that 'for' loop makes the Drools
engine to come up with the same error (no such identifier).

I commented the loop and it does not throw that error.

Any ideas why this happens?

Thanks

On Tue, Jan 10, 2012 at 9:04 PM, Martin A wml...@gmail.com wrote:

 Hi, Mauricio,

 Thanks for the help.. but what do you mean by '  that loop is not doing
 anything  '

 Regards,
 Martin


 On Tue, Jan 10, 2012 at 8:59 PM, Mauricio Salatino sala...@gmail.comwrote:

 yeah.. sort of..
 you can do

 $gsc.doSomething($item.id);
   for (int i = 0; i  $item.quantity; i++) {
 $gsc.doSomethingElse($item.id);
   }
 update($gsc);

 but by the way.. that loop is not doing anything ..


 2012/1/10 Martin A wml...@gmail.com:
  Hello,
 
  I suppose that means something like:
 
  modify ($gsc) {
  doSomething($item.id);
  }
 
 
  for (int i = 0; i  $item.quantity; i++) {
 $gsc.doSomethingElse($item.id);
  }
 
  update($gsc);
 
  Thanks,
  Martin
 
  2012/1/10 Wolfgang Laun wolfgang.l...@gmail.com
 
  No can do, because within a modify block a comma-separated list of
  (setter) method calls of the object between the parentheses must be
 written.
 
  Note that you can change a fact (without a modify statement) - just
 follow
  this with an update call.
 
  See the Expert manual for details.
 
  -W
 
 
  2012/1/10 Martin A wml...@gmail.com
 
  Hello, guys,
 
  I have the following snippet of a right side rule:
 
 
  modify ($gsc) {
  doSomething($item.id);
 
  for (int i = 0; i  $item.quantity; i++) {
  doSomethingElse($item.id);
  }
  }
 
  which looks like is invalid syntax in some way, but it comes out with
  strange error report, such as '[Error: no such identifier: $item]'
 
  Would you please assist me on how to put that loop inside that modify
  block?
 
  Thank you and regards,
  Martin
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 



 --
  - CTO @ http://www.plugtree.com
  - MyJourney @ http://salaboy.wordpress.com
  - Co-Founder @ http://www.jugargentina.org
  - Co-Founder @ http://www.jbug.com.ar

  - Salatino Salaboy Mauricio -

 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Large number of rules in Drools

2012-01-10 Thread Shweta1986
My rules are  as follows.
rule rule1
salience -2
dialect mvel
when
stud : Student ( field == ARTS, state.equals(WA))
then
java.util.List subList = new java.util.ArrayList();
Subject subject = new Subject();
subject.setName(ABC);
subject.setFees(33454);
subject.duration(4);
subList.add(subject);

subject = new Subject();
subject.setName(XYZ);
subject.setFees(33454);
subject.duration(4);
subList.add(subject);

stud.setSubjects(subList);
end
rule rule2
salience -100
dialect mvel
when
stud : Student ( field == ARTS, state.equals(WA) , city ==
SEATTLE))
then
java.util.List subList = new java.util.ArrayList();
Subject subject = new Subject();
subject.setName(ABC);
subject.setFees(33454);
subject.duration(4);
subList.add(subject);

subject = new Subject();
subject.setName(XYZ);
subject.setFees(33454);
subject.duration(4);
subList.add(subject);

stud.setSubjects(subList);
end



Student is the main object and it contains List of Subjects. here the way I
am using the salience because
if the input us shweta, ARTS, WA,Olympia it matched rule1
but if the input is shweta, ARTS, WA, Seattle it matches 1 and 2 but i want
the rule 2 to be executed  so salience.

I am using StatelessKnowledge Session and also the resource change scanner.
I execute one rule at a time and the scanner poll interval is 1 hour.
When I started with 100 rules I was using PK as my source in
changeSet.xml but when the rules grew to 20K I was not able to build the
rules in Guvnor UI and hence I started using DRL as source.

The way I generate drl is using a script which converts the csv to drl
format.
I copy the drl to the text area in techincal rules and save it. ( this copy
is also paiful so I asked that if there is an upload drl file unlike the
import drl file)
In changeset I give the path to the url in webdav
/guvnor/org.drools.guvnor.Guvnor/webdav/packages/StudentRules/StudentRules.drl

I am not sure if I am doing it the right way. Please suggest.

Thanks,
Shweta

On Mon, Jan 9, 2012 at 11:58 PM, laune [via Drools] 
ml-node+s46999n364701...@n3.nabble.com wrote:

 Salience is just one way to force the evaluation of a condition before
 others. In fact, using salience throughout is just a way of re-creating a
 sequence of plain old if statements using a rules engine.

 I'm not going to waste my time and yours by elaborating on possible
 alternatives unless you come up with a detailed description of your rules,
 and how you run your rules engine: fact insertion, calls to fire, etc.

 -W

 2012/1/10 Shweta1986 [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3647015i=0
 

 I am not sure I understand that. What is the other option for this case.
 Why would simple rules not work for 20 K rules. Am I missing something. I
 cannot use database to store my rules. Drools also gives me salience which
 I need for my usecase.

 On Thu, Jan 5, 2012 at 11:29 PM, laune [via Drools] [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3646449i=0
  wrote:

 2012/1/6 Shweta1986 [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3637255i=0
 

 And my rules are very simple it is like if string comparison then set
 that's it..

 This doesn't really warrant the use of a rule based system. If keeping
 this logic out of the application or an easy maintenance of these if-then's
 are your main goals, there are other ways. I've already hinted at this,
 with the idea of providing the information embedded in similar rules as
 data.
 -W



 ___
 rules-users mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=3637255i=1
 https://lists.jboss.org/mailman/listinfo/rules-users


 --
  If you reply to this email, your message will be added to the
 discussion below:

 http://drools.46999.n3.nabble.com/Large-number-of-rules-in-Drools-tp3630385p3637255.html
  To start a new topic under Drools: User forum, email [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3646449i=1
 To unsubscribe from Drools: User forum, click here.
 NAMLhttp://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespacebreadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml



 --
 View this message in context: Re: [rules-users] Large number of rules in
 Droolshttp://drools.46999.n3.nabble.com/Large-number-of-rules-in-Drools-tp3630385p3646449.html

 Sent from the Drools: User forum mailing list 
 archivehttp://drools.46999.n3.nabble.com/Drools-User-forum-f47000.htmlat 
 Nabble.com.

 ___
 rules-users mailing list
 [hidden email] 

Re: [rules-users] For loop inside a modify block problem

2012-01-10 Thread Davide Sottara
Did you remember to bind $item to some expression in the LHS ? Maybe you just
called that item without the $ :)
Davide

(the original modify syntax is still wrong anyway)

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-For-loop-inside-a-modify-block-problem-tp3648460p3648718.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Large number of rules in Drools

2012-01-10 Thread Wolfgang Laun
Assuming that the remaining 19998 rules are of the same kind, there is a
lot of data in these rules, and only very little logic. Ignoring the issue
of Olympia being one of the cities not being Seattle, we have the
problem of matching a triplet of field,state,city from a Student fact so
that we can store one or more Subjects in Student.subjects.

Imagine that you have objects of type Inscribe containing a triplet of
field, state, city and the pertaining ListSubject. Then you could write a
single (!) rule

rule register
when
  $stu: Student ( $f: field, $s: state, $c: city )
  $ins: Inscribe( field==$f, state==$s, city==$c )
then
  $stu.setSubjects( $ins.getSubjects() );
end

BTW: Why do you use equals with state? Using == should be possible here,
too.

And, of course, matching ~2 different triplets to facts of a single
type isn't really RBS fodder. You can design a simple Java program that
achieves this goal, assuming you can come up with a straightforward
representation of the field,state,city;subject+ mapping.

-W


2012/1/10 Shweta1986 shweta.a.thak...@gmail.com

 My rules are  as follows.
 rule rule1
 salience -2
 dialect mvel
 when
 stud : Student ( field == ARTS, state.equals(WA))
 then
 java.util.List subList = new java.util.ArrayList();
 Subject subject = new Subject();
 subject.setName(ABC);
 subject.setFees(33454);
 subject.duration(4);
 subList.add(subject);

 subject = new Subject();
 subject.setName(XYZ);
 subject.setFees(33454);
 subject.duration(4);
 subList.add(subject);

 stud.setSubjects(subList);
 end
 rule rule2
 salience -100
 dialect mvel
 when
 stud : Student ( field == ARTS, state.equals(WA) , city ==
 SEATTLE))
 then
 java.util.List subList = new java.util.ArrayList();
 Subject subject = new Subject();
 subject.setName(ABC);
 subject.setFees(33454);
 subject.duration(4);
 subList.add(subject);

 subject = new Subject();
 subject.setName(XYZ);
 subject.setFees(33454);
 subject.duration(4);
 subList.add(subject);

 stud.setSubjects(subList);
 end



 Student is the main object and it contains List of Subjects. here the way
 I am using the salience because
 if the input us shweta, ARTS, WA,Olympia it matched rule1
 but if the input is shweta, ARTS, WA, Seattle it matches 1 and 2 but i
 want the rule 2 to be executed  so salience.

 I am using StatelessKnowledge Session and also the resource change scanner.
 I execute one rule at a time and the scanner poll interval is 1 hour.
 When I started with 100 rules I was using PK as my source in
 changeSet.xml but when the rules grew to 20K I was not able to build the
 rules in Guvnor UI and hence I started using DRL as source.

 The way I generate drl is using a script which converts the csv to drl
 format.
 I copy the drl to the text area in techincal rules and save it. ( this
 copy is also paiful so I asked that if there is an upload drl file unlike
 the import drl file)
 In changeset I give the path to the url in webdav
 /guvnor/org.drools.guvnor.Guvnor/webdav/packages/StudentRules/StudentRules.drl

 I am not sure if I am doing it the right way. Please suggest.

 Thanks,
 Shweta

 On Mon, Jan 9, 2012 at 11:58 PM, laune [via Drools] [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3648661i=0
  wrote:

 Salience is just one way to force the evaluation of a condition before
 others. In fact, using salience throughout is just a way of re-creating a
 sequence of plain old if statements using a rules engine.

 I'm not going to waste my time and yours by elaborating on possible
 alternatives unless you come up with a detailed description of your rules,
 and how you run your rules engine: fact insertion, calls to fire, etc.

 -W

 2012/1/10 Shweta1986 [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3647015i=0
 

 I am not sure I understand that. What is the other option for this case.
 Why would simple rules not work for 20 K rules. Am I missing something. I
 cannot use database to store my rules. Drools also gives me salience which
 I need for my usecase.

 On Thu, Jan 5, 2012 at 11:29 PM, laune [via Drools] [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3646449i=0
  wrote:

 2012/1/6 Shweta1986 [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3637255i=0
 

 And my rules are very simple it is like if string comparison then set
 that's it..

 This doesn't really warrant the use of a rule based system. If keeping
 this logic out of the application or an easy maintenance of these if-then's
 are your main goals, there are other ways. I've already hinted at this,
 with the idea of providing the information embedded in similar rules as
 data.
 -W



 ___
 rules-users mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=3637255i=1
 https://lists.jboss.org/mailman/listinfo/rules-users


 --
  If you reply to 

Re: [rules-users] Large number of rules in Drools

2012-01-10 Thread Shweta1986
I can look into the solution of writing my own Java application for this
solution. But I would still like to understand, if the problem is just
because of the 3 values being checked in the rules ? Do complex rules dont
have more than 1 checks ?
If yes then this case should be supported no matter how simple the rule is
right ?

Also for the UI issue I mentioned. Assume some other complex rules. Is
copying the thousands of lines in the text area not a problem in guvnor ?

On Tue, Jan 10, 2012 at 12:38 PM, laune [via Drools] 
ml-node+s46999n3648792...@n3.nabble.com wrote:

 Assuming that the remaining 19998 rules are of the same kind, there is a
 lot of data in these rules, and only very little logic. Ignoring the issue
 of Olympia being one of the cities not being Seattle, we have the
 problem of matching a triplet of field,state,city from a Student fact so
 that we can store one or more Subjects in Student.subjects.

 Imagine that you have objects of type Inscribe containing a triplet of
 field, state, city and the pertaining ListSubject. Then you could write a
 single (!) rule

 rule register
 when
   $stu: Student ( $f: field, $s: state, $c: city )
   $ins: Inscribe( field==$f, state==$s, city==$c )
 then
   $stu.setSubjects( $ins.getSubjects() );
 end

 BTW: Why do you use equals with state? Using == should be possible here,
 too.

 And, of course, matching ~2 different triplets to facts of a single
 type isn't really RBS fodder. You can design a simple Java program that
 achieves this goal, assuming you can come up with a straightforward
 representation of the field,state,city;subject+ mapping.

 -W


 2012/1/10 Shweta1986 [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3648792i=0
 

 My rules are  as follows.

 rule rule1
 salience -2
 dialect mvel
 when
 stud : Student ( field == ARTS, state.equals(WA))
 then
 java.util.List subList = new java.util.ArrayList();
 Subject subject = new Subject();
 subject.setName(ABC);
 subject.setFees(33454);
 subject.duration(4);
 subList.add(subject);

 subject = new Subject();
 subject.setName(XYZ);
 subject.setFees(33454);
 subject.duration(4);
 subList.add(subject);

 stud.setSubjects(subList);
 end
 rule rule2
 salience -100
 dialect mvel
 when
 stud : Student ( field == ARTS, state.equals(WA) , city ==
 SEATTLE))
 then
 java.util.List subList = new java.util.ArrayList();
 Subject subject = new Subject();
 subject.setName(ABC);
 subject.setFees(33454);
 subject.duration(4);
 subList.add(subject);

 subject = new Subject();
 subject.setName(XYZ);
 subject.setFees(33454);
 subject.duration(4);
 subList.add(subject);

 stud.setSubjects(subList);
 end



 Student is the main object and it contains List of Subjects. here the way
 I am using the salience because
 if the input us shweta, ARTS, WA,Olympia it matched rule1
 but if the input is shweta, ARTS, WA, Seattle it matches 1 and 2 but i
 want the rule 2 to be executed  so salience.

 I am using StatelessKnowledge Session and also the resource change
 scanner.
 I execute one rule at a time and the scanner poll interval is 1 hour.
 When I started with 100 rules I was using PK as my source in
 changeSet.xml but when the rules grew to 20K I was not able to build the
 rules in Guvnor UI and hence I started using DRL as source.

 The way I generate drl is using a script which converts the csv to drl
 format.
 I copy the drl to the text area in techincal rules and save it. ( this
 copy is also paiful so I asked that if there is an upload drl file unlike
 the import drl file)
 In changeset I give the path to the url in webdav
 /guvnor/org.drools.guvnor.Guvnor/webdav/packages/StudentRules/StudentRules.drl

 I am not sure if I am doing it the right way. Please suggest.

 Thanks,
 Shweta

 On Mon, Jan 9, 2012 at 11:58 PM, laune [via Drools] [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3648661i=0
  wrote:

 Salience is just one way to force the evaluation of a condition before
 others. In fact, using salience throughout is just a way of re-creating a
 sequence of plain old if statements using a rules engine.

 I'm not going to waste my time and yours by elaborating on possible
 alternatives unless you come up with a detailed description of your rules,
 and how you run your rules engine: fact insertion, calls to fire, etc.

 -W

 2012/1/10 Shweta1986 [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3647015i=0
 

 I am not sure I understand that. What is the other option for this
 case. Why would simple rules not work for 20 K rules. Am I missing
 something. I cannot use database to store my rules. Drools also gives me
 salience which I need for my usecase.

 On Thu, Jan 5, 2012 at 11:29 PM, laune [via Drools] [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3646449i=0
  wrote:

 2012/1/6 Shweta1986 [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3637255i=0
 

[rules-users] No Such Field Error:DESCR in implementing ChangeSet

2012-01-10 Thread srinivasasanda
Hi,

I'm trying to implement CHANGESET.xml functinlaity through some example.Here
is my code
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

//kbuilder.add(ResourceFactory.newUrlResource(file:d:\\rulestest\\changeset.xml),
ResourceType.CHANGE_SET);

kbuilder.add(ResourceFactory.newUrlResource(
file:d:\\rulestest\\changeset.xml), ResourceType.CHANGE_SET
);

KnowledgeBuilderErrors errors = kbuilder.getErrors();

if (errors.size()  0) {

for (KnowledgeBuilderError error: errors) {

System.
err.println(error);

But It is generating exception as
java.lang.NoSuchFieldError: DESCR

at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:539)

at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)

at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:42)

at com.sample.DroolsTest.main(DroolsTest.java:24)

Im using guvnor 5.2..Could you please suggest me

Thanks

--
View this message in context: 
http://drools.46999.n3.nabble.com/No-Such-Field-Error-DESCR-in-implementing-ChangeSet-tp3649736p3649736.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Unable to do Guvnor Authentiation with MySQL

2012-01-10 Thread Sumeet Karawal

Hi,

Has anybody encountered the similar problem, could someone please help me
on this.

TIA,
Sumeet
Mailto: sumeet.kara...@tcs.com

- Forwarded by Sumeet Karawal/MUM/TCS on 01/11/2012 05:16 PM -

  
  From:   Sumeet Karawal sumeet.kara...@tcs.com   
  

  
  To: rules-users@lists.jboss.org   
  

  
  Date:   01/09/2012 08:18 PM   
  

  
  Subject:[rules-users] Unable to do Guvnor Authentiation with MySQL
  

  
  Sent by:rules-users-boun...@lists.jboss.org   
  

  






Hi All,

I am trying to enable authentication in Guvnor using MySQL. I am using
MySQL 5.1, Guvnor 5.2 and JBoss AS 5.0.4

I searched over a lot of docs and tried to do as mentioned below :

   I have created a GuvnorDB in MySQL with two tables
 create table Principals(principal_id VARCHAR(64),password
VARCHAR
(64));
 create table roles(principal_id VARCHAR(64),user_role VARCHAR
(64),role_group VARCHAR(64));

and have entered some values accordingly (admin, admin123)  and (admin,
admin, admin);

   My components.xml in drools-guvnor.war is as follows :

?xml version=1.0 encoding=UTF-8?
components xmlns=http://jboss.com/products/seam/components;
xmlns:core=http://jboss.com/products/seam/core;
xmlns:security=http://jboss.com/products/seam/security;
xmlns:web=http://jboss.com/products/seam/web;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:transaction=http://jboss.com/products/seam/transaction;
xsi:schemaLocation=http://jboss.com/products/seam/core
http://jboss.com/products/seam/core-2.0.xsd
 http://jboss.com/products/seam/security
http://jboss.com/products/seam/security-2.0.xsd
 http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-2.0.xsd
 http://jboss.com/products/seam/web
http://jboss.com/products/seam/web-2.0.xsd
 http://jboss.com/products/seam/transaction
http://jboss.com/products/seam/transaction-2.0.xsd;


core:init transaction-management-enabled=false /
transaction:no-transaction /

component name=repositoryConfiguration

!-- JackRabbit  --

property name=properties

keyorg.drools.repository.configurator/keyvalueorg.drools.repository.jackrabbit.JackrabbitRepositoryConfigurator/value


/property



/component

!-- SECURITY IDENTITY CONFIGURATION --


   security:identity authenticate-method=#{authenticator.authenticate}
jaas-config-name=mysql/



!-- SECURITY AUTHORIZATION CONFIGURATION --

component name=org.jboss.seam.security.roleBasedPermissionResolver
property name=enableRoleBasedAuthorizationtrue/property
/component

/components


   I have also changed my login-config.xml accordingly and added a
   application policy :

application-policy name=mysql
 authentication
 login-module code=org.jboss.security.auth.spi.DatabaseServerLoginModule
flag=required
 module-option name=dsJndiNamejava:/MySqlDS/module-option
 module-option name=principalsQueryselect password from principals
where principal_id=?/module-option
 module-option name=principalsQueryselect user_role,'Roles' from roles
where principal_id=?/module-option

 /login-module
 /authentication
 /application-policy


   I have also created a mysql-ds.xml and saved it in the default/deploy
   folder; its contents :

?xml version=1.0 encoding=UTF-8?
datasources
local-tx-datasource
jndi-nameMySqlDS/jndi-name
connection-urljdbc:mysql://localhost:3306/GuvnorDB/connection-url
driver-classcom.mysql.jdbc.Driver/driver-class
user-nameroot/user-name
password/password

valid-connection-checker-class-nameorg.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker/valid-connection-checker-class-name

metadata
type-mappingmySQL/type-mapping
/metadata

Re: [rules-users] No Such Field Error:DESCR in implementing ChangeSet

2012-01-10 Thread srinivasasanda
I got succeeded..There is problem in Drools Jars of different versions.

Thanks

--
View this message in context: 
http://drools.46999.n3.nabble.com/No-Such-Field-Error-DESCR-in-implementing-ChangeSet-tp3649736p3649848.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users