Re: [rules-users] stuck! Unknown accessor type: org.mvel2.optimizers.impl.refl.collection.ArrayCreator@690c2a7a

2014-01-23 Thread Mario Fusco
I just fixed this issue on master with this commit:
https://github.com/droolsjbpm/drools/commit/fb7c8858f

Thank you for having reported it,
Mario



--
View this message in context: 
http://drools.46999.n3.nabble.com/stuck-Unknown-accessor-type-org-mvel2-optimizers-impl-refl-collection-ArrayCreator-690c2a7a-tp4020969p4027818.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] stuck! Unknown accessor type: org.mvel2.optimizers.impl.refl.collection.ArrayCreator@690c2a7a

2014-01-23 Thread brachi
Thank you.
few questions:
1. does exist an option to dismiss this error, even if it says to disable
this mvel constraints optimizations?
2. when and where will it be released? can it be fixed on 5.5 or 5.6?




--
View this message in context: 
http://drools.46999.n3.nabble.com/stuck-Unknown-accessor-type-org-mvel2-optimizers-impl-refl-collection-ArrayCreator-690c2a7a-tp4020969p4027820.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] Buggy query behavior in drools 5.6 and 6.1-SNAPSHOT ??

2014-01-23 Thread Esteban Aliverti
Let me see what I can do.




Esteban Aliverti
- Blog @ http://ilesteban.wordpress.com


On Thu, Jan 23, 2014 at 12:18 AM, Davide Sottara dso...@gmail.com wrote:

  Esteban, I have created a ticket for this with
 an explanation of the weird behavior.

 https://issues.jboss.org/browse/DROOLS-414

 The problem is in QueryElementBuilder line#343.
 It's an easy fix but I don't have time for it right now,
 could someone look into it?

 Thanks
 Davide



 On 01/22/2014 06:00 PM, Esteban Aliverti wrote:

 Good catch Davide. I can confirm that not using nested accessors the query
 works as expected.

  Regards,


 

 Esteban Aliverti
 - Blog @ http://ilesteban.wordpress.com


 On Wed, Jan 22, 2014 at 6:57 PM, Davide Sottara dso...@gmail.com wrote:

  Indeed, the use case can be simplified further:

 package org.drools.test.bc;

 declare Parent
 attribute2 : String
 end

 declare Child
 parentId : String
 end

 query getChildWithName( String $parentId, Child $child )
 $child:= Child( parentId == $parentId )

 end

 rule Insert Children
 when
  then
 Parent p1 = new Parent( a1 );
 Child c1p1 = new Child( 1 );

 insert( c1p1 );
 insert( p1 );

 end

 rule Rule A
 when
  $p: Parent( $a2 : attribute2 )
 ?getChildWithName( $p.attribute2, $child;)
 then
 System.out.println(FOUND: + $child ++ $child.getParentId()
 +  ==  + $p.getAttribute2() +  ?? );
 end

 It has nothing to do with nested objects, @PR or modifications.
 It seems that the culprit is the chained property accessor.


 Davide



 On 01/22/2014 02:22 PM, Esteban Aliverti wrote:

  Hi guys,
 I was writing some rules using backward chaining and found a strange
 behavior.
 I managed to isolate the error in the test project I'm attaching.

  In the project I have 2 classes: Parent and Child

  Parent:
 * String id
 * String attribute1
 * String attribute2
 * ListChild children

  Child:
 * String parentId;
 * String name;
 * String value;


  In the test I'm creating 1 Parent object with just 1 child and then
 inserting the Parent object into a drools session:

  Parent p1 = new Parent();
 p1.setId(1);
 p1.setAttribute1(a1);
 p1.setAttribute2(null);

  Child c1p1 = new Child();
 c1p1.setName(n1);
 c1p1.setParentId(p1.getId());
 c1p1.setValue(v1.1);
 p1.addChild(c1p1);

 kSession.insert(p1);
 kSession.fireAllRules();


  So far so good.
 The rules I have in my session are the following:

  declare Parent
 @propertyReactive
 end

  query getChildWithName(String $parentId, String $name, Child $child)
 $child:= Child(parentId == $parentId, name == $name)
 end

  rule Insert Children
 when
 $p: Parent()@watch(!*)
 $c: Child() from $p.children
 then
 System.out.println(Inserting child +$c);
 insert($c);
 end

  rule Rule A
 when
 $p: Parent(attribute2 != null)
 ?getChildWithName($p.attribute2, n1, $child;)
 then
 System.out.println(FOUND: +$child+. The attribute 'parentId' of
 this object must have the value '+$p.getAttribute2()+'. Does it?
 +$child.getParentId()+ == +$p.getAttribute2()+ ??);
 globalList.add($child);
 end


  rule Copy Attribute1 into Attribute2
 when
 $p: Parent(attribute1 != null, attribute2 == null)
 then
 modify($p){
 setAttribute2($p.getAttribute1())
 }
 end

  The important part here is 'Rule A' and 'Copy Attribute1 into
 Attribute2'. The latter copies the value of attribute1 to attribute2 for
 any Parent object present in the session. (Note that the parent I'm
 inserting has attribute2 = null). 'Rule A' is then using a query to get a
 Child object that has a parent with id = $p.attribute2 (where $p is a
 previously matched Parent).
 Given that I only have 1 Parent in my session and that its id is '1' I
 don't expect 'Rule A' to be activated/executed. When I modify
 parent.attribute2 in 'Copy Attribute1 into Attribute2' I'm setting its
 value to 'a1'. 'Rule A' (via the query) should then look for a Child with
 parentid = 'a1' and It shouldn't find anything.
 Funny thing is that 'Rule A' activates and fires. The child object that
 is 'returned' by the query has a parentId of '1' so I don't know how this
 behavior is possible. If you take a look at the System.out output you will
 see that the activation makes no sense at all.

  Am I doing something wrong in my project? Is this a bug? Is this the
 expected behavior?

  Regards,



 

 Esteban Aliverti
 - Blog @ http://ilesteban.wordpress.com


   ___
 rules-users mailing 
 listrules-users@lists.jboss.orghttps://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] java dialect and declared types

2014-01-23 Thread pmander
If I declare a type in a drl and reference the attributes in a rule then all
is fine for either dialect. But, if one of the attributes is a java class
that has been compiled and inserted then under the java dialect only I get a
compilation error: rule compilation error the field ... is not visible

for example

declare DroolsTransaction
ORG : String
PRODUCT : String
raw : Transaction
end

rule create classes
salience 100
when
$t : Transaction()
then
insert(new DroolsTransaction((String)$t.fieldFor(ORG),
(String)$t.fieldFor(PRODUCT), $t));
end

I insert Transaction objects in the session and this works fine for the
following rule if I have the dialect set to mvel.

rule 1
when
$t : DroolsTransaction(ORG == A , PRODUCT == 001, raw.complicated())
then
do something
end

but when I switch dialects to java, the compilation complains that raw is
not visible.

I guess drools is dynamically creating the DroolsTransaction object with
private fields... and I need public accessors - how to define them?



--
View this message in context: 
http://drools.46999.n3.nabble.com/java-dialect-and-declared-types-tp4027822.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] java dialect and declared types

2014-01-23 Thread Davide Sottara
Declared types have public accessors as usual.
This seems a minor bug in the expression analysis.
Can you try

getRaw().complicated()

and / or

raw.complicated

and report what happens?
Thanks
Davide

On 01/23/2014 06:40 AM, pmander wrote:
 If I declare a type in a drl and reference the attributes in a rule then all
 is fine for either dialect. But, if one of the attributes is a java class
 that has been compiled and inserted then under the java dialect only I get a
 compilation error: rule compilation error the field ... is not visible

 for example

 declare DroolsTransaction
 ORG : String
 PRODUCT : String
 raw : Transaction
 end

 rule create classes
 salience 100
 when
   $t : Transaction()
 then
 insert(new DroolsTransaction((String)$t.fieldFor(ORG),
 (String)$t.fieldFor(PRODUCT), $t));
 end

 I insert Transaction objects in the session and this works fine for the
 following rule if I have the dialect set to mvel.

 rule 1
 when
   $t : DroolsTransaction(ORG == A , PRODUCT == 001, raw.complicated())
 then
   do something
 end

 but when I switch dialects to java, the compilation complains that raw is
 not visible.

 I guess drools is dynamically creating the DroolsTransaction object with
 private fields... and I need public accessors - how to define them?



 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/java-dialect-and-declared-types-tp4027822.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] java dialect and declared types

2014-01-23 Thread pmander
will do, although complicated() has parameters and so I think I'll only able
to try getRaw.complicated()



--
View this message in context: 
http://drools.46999.n3.nabble.com/java-dialect-and-declared-types-tp4027822p4027825.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] java dialect and declared types

2014-01-23 Thread Davide Sottara
In that case I'm almost sure that the whole constraint has to be treated
as a java expression.
So yes, you will probably need getRaw().complicated( ... )

On 01/23/2014 08:06 AM, pmander wrote:
 will do, although complicated() has parameters and so I think I'll only able
 to try getRaw.complicated()



 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/java-dialect-and-declared-types-tp4027822p4027825.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] java dialect and declared types

2014-01-23 Thread Davide Sottara
Yes, if you use the java dialect, the whole RHS is parsed as a java block
with some minor syntactic sugar (e.g. insert).

On 01/23/2014 08:46 AM, pmander wrote:
 Davide Sottara wrote
 Declared types have public accessors as usual.
 This seems a minor bug in the expression analysis.
 Can you try

 getRaw().complicated()

 and / or

 raw.complicated

 and report what happens?
 Thanks
 Davide
 getRaw().complicated() works. This isn't just in the constraint. I use raw
 in the then also and it needs changing to getRaw() also.

 Thanks



 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/java-dialect-and-declared-types-tp4027822p4027827.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] java dialect and declared types

2014-01-23 Thread Mark Proctor
please do pop onto irc and provides us with more details on the performance 
testing you are doing. We need to add more tests to our test suite, to track 
any regressions.
http://www.jboss.org/drools/irc

Mark

On 23 Jan 2014, at 15:11, pmander paul.s.man...@gmail.com wrote:

 Thanks,
 
 This was just for a performance test to check mvel against java. Mvel in our
 case is quicker. The tests also show that 5.5.0 is quicker than 6.0.0.
 
 
 
 
 
 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/java-dialect-and-declared-types-tp4027822p4027829.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] java dialect and declared types

2014-01-23 Thread Mario Fusco
Hi,

I'd like to reproduce and verify your performance claims. 
If you found a performance regression it would be very interesting for me to
investigate it.
Could you please send a small self-contained project with the benchmarks you
tried? 

Personally I believe that The tests also show that 5.5.0 is quicker than
6.0.0 isn't true in general. For instance Geoffrey De Smet just published a
performance comparison between phreak (the default algorithm in 6) and
reteoo demonstrating quite the opposite:
http://blog.athico.com/2014/01/which-rule-engine-algorithm-is-faster.html

Nevertheless it is very possible that your claim is perfectly valid for your
test case, so I'd like to discover under which circumstances 5.5. is
actually faster than 6 and check if we can improve also in those cases.

Thanks,
Mario



--
View this message in context: 
http://drools.46999.n3.nabble.com/java-dialect-and-declared-types-tp4027822p4027831.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] kContainer.newKieSession() fails in Apache Karaf

2014-01-23 Thread jhusby
I wasn't subscribed to the mailing list so I don't think my message below
went through.  Apologies if it did.


jhusby wrote
 I'm trying to run Drools in an OSGi container (Apache Karaf 2.3.3 to be
 precise).  When I try to call newKieSession() on a KieContainer, I get an
 exception as follows:
 
 java.lang.IllegalArgumentException: conflict Resolver
 'org.drools.core.conflict.DepthConflictResolver' not found
   at
 org.drools.core.RuleBaseConfiguration.determineConflictResolver(RuleBaseConfiguration.java:868)[276:org.drools.core:6.0.1.20131220-0333]
   at
 org.drools.core.RuleBaseConfiguration.init(RuleBaseConfiguration.java:459)[276:org.drools.core:6.0.1.20131220-0333]
   at
 org.drools.core.RuleBaseConfiguration.init(RuleBaseConfiguration.java:415)[276:org.drools.core:6.0.1.20131220-0333]
   at org.drools.core.RuleBaseConfiguration.
 init
 (RuleBaseConfiguration.java:402)[276:org.drools.core:6.0.1.20131220-0333]
   at
 org.drools.core.impl.KnowledgeBaseFactoryServiceImpl.newKnowledgeBaseConfiguration(KnowledgeBaseFactoryServiceImpl.java:37)[276:org.drools.core:6.0.1.20131220-0333]
   at
 org.kie.internal.KnowledgeBaseFactory.newKnowledgeBaseConfiguration(KnowledgeBaseFactory.java:125)[275:org.kie.internalapi:6.0.1.20131220-0322]
   at
 org.drools.compiler.kie.builder.impl.KieContainerImpl.getKnowledgeBaseConfiguration(KieContainerImpl.java:323)[277:org.drools.compiler:6.0.1.20131220-0333]
   at
 org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:316)[277:org.drools.compiler:6.0.1.20131220-0333]
   at
 org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:257)[277:org.drools.compiler:6.0.1.20131220-0333]
   at
 org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:400)[277:org.drools.compiler:6.0.1.20131220-0333]
   at
 org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:349)[277:org.drools.compiler:6.0.1.20131220-0333]
   at
 org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:331)[277:org.drools.compiler:6.0.1.20131220-0333]
 
 As a workaround, I was able to get it working by doing this:
 
   KieBaseConfiguration kbaseConf = KnowledgeBaseFactory
   .newKnowledgeBaseConfiguration(
   null,
   
 getClass().getClassLoader(),
   
 RuleBaseConfiguration.class.getClassLoader()
   );
   KieBase kbase = kContainer.newKieBase(kbaseConf);
   kSession = kbase.newKieSession();
 
 but this is obviously less than ideal.  Any ideas on how to make this work
 better in OSGi?
 
 Thank you!
 
 Joseph





--
View this message in context: 
http://drools.46999.n3.nabble.com/kContainer-newKieSession-fails-in-Apache-Karaf-tp4027815p4027832.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] Dynamic rules in Drools 6

2014-01-23 Thread jhusby
Looking at the test case from Edson, quoted below, it appears that there's no
way to reuse a current session when upgrading the kbase rules?  I need to
add and remove rules on the fly, and so if I have a stateful session, does
this mean I need to dispose of the current session, upgrade the container,
create a new session, and repopulate it with all my objects? 

I was hoping to simply rebuild the repository, call
kContainer.updateToVersion(), and have the the session (with all my objects
still populated) automatically use that new version of the rules repository. 
Is this not possible? 

Thanks, 
Joseph 


 Edson Tirelli-4 wrote
 Here is a code example of creating kie modules in memory and upgrading 
 existing kbases/ksessions: 
 
 https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java#L106
 
It is a test case, but maybe it will be easier to follow. We are
 working 
 on additional ways of doing similar things as well. 
 
Edson





--
View this message in context: 
http://drools.46999.n3.nabble.com/Dynamic-rules-in-Drools-6-tp4027833.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] java dialect and declared types

2014-01-23 Thread pmander
I should qualify this with the way that we are using drools. In general
perhaps 6 is quicker that 5.5. It will be extremely difficult to create a
self contained test to demonstrate this as the tests are performed with tens
of millions of transactions against ten of thousands of rules.

I will however attempt to scale this down to something that can demonstrate
these findings. This wont happen straight away so pin this thread and
hopefully in a week or so I will be able to submit something.



--
View this message in context: 
http://drools.46999.n3.nabble.com/java-dialect-and-declared-types-tp4027822p4027834.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] Dynamic rules in Drools 6

2014-01-23 Thread Davide Sottara
There may be some misunderstanding here..
you can indeed rebuild the jar, but there is also a programmatic
way to add (DRL) resources to an in-memory FS and update
the KBs/KSs on the fly. See the examples in IncrementalCompilationTests
Davide

On 01/23/2014 10:11 AM, Mark Proctor wrote:
 On 23 Jan 2014, at 16:02, jhusby husby...@umn.edu wrote:

 Looking at the test case from Edson, quoted below, it appears that there's no
 way to reuse a current session when upgrading the kbase rules?  I need to
 add and remove rules on the fly, and so if I have a stateful session, does
 this mean I need to dispose of the current session, upgrade the container,
 create a new session, and repopulate it with all my objects? 

 I was hoping to simply rebuild the repository, call
 kContainer.updateToVersion(), and have the the session (with all my objects
 still populated) automatically use that new version of the rules repository. 
 Is this not possible? 

 yes,this is how it works now. Make sure you build the jar with the maven 
 plugin, so that it can performance the incremental diff. We have a number of 
 low level unit tests, that show this should work. If you have found a bug, 
 please update the test class here:
 https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java

 Mark


 Thanks, 
 Joseph 


 Edson Tirelli-4 wrote
 Here is a code example of creating kie modules in memory and upgrading 
 existing kbases/ksessions: 

 https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java#L106

   It is a test case, but maybe it will be easier to follow. We are
 working 
 on additional ways of doing similar things as well. 

   Edson




 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Dynamic-rules-in-Drools-6-tp4027833.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] Dynamic rules in Drools 6

2014-01-23 Thread Mark Proctor

On 23 Jan 2014, at 16:02, jhusby husby...@umn.edu wrote:

 Looking at the test case from Edson, quoted below, it appears that there's no
 way to reuse a current session when upgrading the kbase rules?  I need to
 add and remove rules on the fly, and so if I have a stateful session, does
 this mean I need to dispose of the current session, upgrade the container,
 create a new session, and repopulate it with all my objects? 
 
 I was hoping to simply rebuild the repository, call
 kContainer.updateToVersion(), and have the the session (with all my objects
 still populated) automatically use that new version of the rules repository. 
 Is this not possible? 
 
yes,this is how it works now. Make sure you build the jar with the maven 
plugin, so that it can performance the incremental diff. We have a number of 
low level unit tests, that show this should work. If you have found a bug, 
please update the test class here:
https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java

Mark


 Thanks, 
 Joseph 
 
 
 Edson Tirelli-4 wrote
 Here is a code example of creating kie modules in memory and upgrading 
 existing kbases/ksessions: 
 
 https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java#L106
 
   It is a test case, but maybe it will be easier to follow. We are
 working 
 on additional ways of doing similar things as well. 
 
   Edson
 
 
 
 
 
 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Dynamic-rules-in-Drools-6-tp4027833.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] kContainer.newKieSession() fails in Apache Karaf

2014-01-23 Thread Charles Moulliard
Hi Joseph,

I propose that you have a look to this example which is currently working
on Karaf - https://github.com/cmoulliard/droolsjbpm-osgi-examples (simple =
OSGI BundleActivator + KieSession + Drools Rules)

Regards,

Charles


On Thu, Jan 23, 2014 at 4:58 PM, jhusby husby...@umn.edu wrote:

 I wasn't subscribed to the mailing list so I don't think my message below
 went through.  Apologies if it did.


 jhusby wrote
  I'm trying to run Drools in an OSGi container (Apache Karaf 2.3.3 to be
  precise).  When I try to call newKieSession() on a KieContainer, I get an
  exception as follows:
 
  java.lang.IllegalArgumentException: conflict Resolver
  'org.drools.core.conflict.DepthConflictResolver' not found
at
 
 org.drools.core.RuleBaseConfiguration.determineConflictResolver(RuleBaseConfiguration.java:868)[276:org.drools.core:6.0.1.20131220-0333]
at
 
 org.drools.core.RuleBaseConfiguration.init(RuleBaseConfiguration.java:459)[276:org.drools.core:6.0.1.20131220-0333]
at
 
 org.drools.core.RuleBaseConfiguration.init(RuleBaseConfiguration.java:415)[276:org.drools.core:6.0.1.20131220-0333]
at org.drools.core.RuleBaseConfiguration.
  init
  (RuleBaseConfiguration.java:402)[276:org.drools.core:6.0.1.20131220-0333]
at
 
 org.drools.core.impl.KnowledgeBaseFactoryServiceImpl.newKnowledgeBaseConfiguration(KnowledgeBaseFactoryServiceImpl.java:37)[276:org.drools.core:6.0.1.20131220-0333]
at
 
 org.kie.internal.KnowledgeBaseFactory.newKnowledgeBaseConfiguration(KnowledgeBaseFactory.java:125)[275:org.kie.internalapi:6.0.1.20131220-0322]
at
 
 org.drools.compiler.kie.builder.impl.KieContainerImpl.getKnowledgeBaseConfiguration(KieContainerImpl.java:323)[277:org.drools.compiler:6.0.1.20131220-0333]
at
 
 org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:316)[277:org.drools.compiler:6.0.1.20131220-0333]
at
 
 org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:257)[277:org.drools.compiler:6.0.1.20131220-0333]
at
 
 org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:400)[277:org.drools.compiler:6.0.1.20131220-0333]
at
 
 org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:349)[277:org.drools.compiler:6.0.1.20131220-0333]
at
 
 org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:331)[277:org.drools.compiler:6.0.1.20131220-0333]
 
  As a workaround, I was able to get it working by doing this:
 
KieBaseConfiguration kbaseConf = KnowledgeBaseFactory
 
 .newKnowledgeBaseConfiguration(
null,
 
 getClass().getClassLoader(),
 
 RuleBaseConfiguration.class.getClassLoader()
);
KieBase kbase = kContainer.newKieBase(kbaseConf);
kSession = kbase.newKieSession();
 
  but this is obviously less than ideal.  Any ideas on how to make this
 work
  better in OSGi?
 
  Thank you!
 
  Joseph





 --
 View this message in context:
 http://drools.46999.n3.nabble.com/kContainer-newKieSession-fails-in-Apache-Karaf-tp4027815p4027832.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




-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] kContainer.newKieSession() fails in Apache Karaf

2014-01-23 Thread jhusby
I actually looked through your example project yesterday; very helpful!!! 
However, there are a few things I'm not sure are compatible with what I'm
trying to do.

1.  I need to rebuild the rules on the fly, so I was using examples from 
the IncrementalCompilationTest.java
https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java
  
to accomplish that task.  However, those tests don't use a classpath
container... can I still rebuild a KieModule via runtime code when running
in a classpathContainer?

2.  Your example code calls .newKieSession() on a kbase object as opposed to
a kContainer object.  Is there a reason why?  If I create a new KieSession
from a kbase vs. kContainer, will I still be able to rebuild the kjar
dynamically in the code and keep using the same stateful session?

3.  It looks like I'll have to wait until Drools 6.1.0 to get the parameter
to specify a classloader when creating the container?  I see you just added
that recently.  I've tried using
Thread.currentThread().setContextClassLoader(...) but can't seem to make
that work with Drools 6.0.1 in Karaf 2.3.3 because then
RuleBaseConfiguration sets the classloader and uses it to try resolving
org.drools.core.conflict.DepthConflictResolver, which it can't do because
it's no longer using the OSGi classloader.

Thank you,

Joseph


Charles Moulliard-2 wrote
 Hi Joseph,
 
 I propose that you have a look to this example which is currently working
 on Karaf - https://github.com/cmoulliard/droolsjbpm-osgi-examples (simple
 =
 OSGI BundleActivator + KieSession + Drools Rules)
 
 Regards,
 
 Charles





--
View this message in context: 
http://drools.46999.n3.nabble.com/kContainer-newKieSession-fails-in-Apache-Karaf-tp4027815p4027838.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] Kie-Workbench install error

2014-01-23 Thread gboro54
Hi! I am trying to install the Kie-workbench war to a jboss 7 environment and
get the exception below. I would imagine this is because of firewall and my
company will not open a connection to this repo. My question: is there a way
to have the deployment go through without loading the example projects?

Thanks!

Caused by: java.lang.RuntimeException:
https://github.com/guvnorngtestuser1/guvnorng-playground.git: cannot open
git-upload-pack
at
org.uberfire.backend.server.repositories.git.GitRepositoryFactoryHelper.newRepository(GitRepositoryFactoryHelper.java:80)
at
org.uberfire.backend.server.repositories.git.GitRepositoryFactoryHelper$Proxy$_$$_WeldClientProxy.newRepository(GitRepositoryFactoryHelper$Proxy$_$$_WeldClientProxy.java)
at
org.uberfire.backend.server.repositories.RepositoryFactoryImpl.newRepository(RepositoryFactoryImpl.java:36)
at
org.uberfire.backend.server.repositories.RepositoryFactoryImpl$Proxy$_$$_WeldClientProxy.newRepository(RepositoryFactoryImpl$Proxy$_$$_WeldClientProxy.java)
at
org.uberfire.backend.server.repositories.RepositoryServiceImpl.createRepository(RepositoryServiceImpl.java:182)
at
org.uberfire.backend.server.repositories.RepositoryServiceImpl.createRepository(RepositoryServiceImpl.java:173)
at
org.uberfire.backend.server.repositories.RepositoryServiceImpl$Proxy$_$$_WeldClientProxy.createRepository(RepositoryServiceImpl$Proxy$_$$_WeldClientProxy.java)
at
org.kie.workbench.drools.backend.server.AppSetup.createRepository(AppSetup.java:274)
at
org.kie.workbench.drools.backend.server.AppSetup.assertPlayground(AppSetup.java:101)
... 43 more




--
View this message in context: 
http://drools.46999.n3.nabble.com/Kie-Workbench-install-error-tp4027840.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] Kie-Workbench install error

2014-01-23 Thread Mark Proctor
http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/wb.Workbench.html#wb.Installation
15.1.3. System properties

org.kie.demo: Enables external clone of a demo application from GitHub. This 
System Property takes precedence over org.kie.example. Default: true
org.kie.example: Enables example structure composed by Repository, Organization 
Unit and Project. Default: false
Mark

On 23 Jan 2014, at 18:38, gboro54 gbor...@gmail.com wrote:

 Hi! I am trying to install the Kie-workbench war to a jboss 7 environment and
 get the exception below. I would imagine this is because of firewall and my
 company will not open a connection to this repo. My question: is there a way
 to have the deployment go through without loading the example projects?
 
 Thanks!
 
 Caused by: java.lang.RuntimeException:
 https://github.com/guvnorngtestuser1/guvnorng-playground.git: cannot open
 git-upload-pack
at
 org.uberfire.backend.server.repositories.git.GitRepositoryFactoryHelper.newRepository(GitRepositoryFactoryHelper.java:80)
at
 org.uberfire.backend.server.repositories.git.GitRepositoryFactoryHelper$Proxy$_$$_WeldClientProxy.newRepository(GitRepositoryFactoryHelper$Proxy$_$$_WeldClientProxy.java)
at
 org.uberfire.backend.server.repositories.RepositoryFactoryImpl.newRepository(RepositoryFactoryImpl.java:36)
at
 org.uberfire.backend.server.repositories.RepositoryFactoryImpl$Proxy$_$$_WeldClientProxy.newRepository(RepositoryFactoryImpl$Proxy$_$$_WeldClientProxy.java)
at
 org.uberfire.backend.server.repositories.RepositoryServiceImpl.createRepository(RepositoryServiceImpl.java:182)
at
 org.uberfire.backend.server.repositories.RepositoryServiceImpl.createRepository(RepositoryServiceImpl.java:173)
at
 org.uberfire.backend.server.repositories.RepositoryServiceImpl$Proxy$_$$_WeldClientProxy.createRepository(RepositoryServiceImpl$Proxy$_$$_WeldClientProxy.java)
at
 org.kie.workbench.drools.backend.server.AppSetup.createRepository(AppSetup.java:274)
at
 org.kie.workbench.drools.backend.server.AppSetup.assertPlayground(AppSetup.java:101)
... 43 more
 
 
 
 
 --
 View this message in context: 
 http://drools.46999.n3.nabble.com/Kie-Workbench-install-error-tp4027840.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] Kie-Workbench install error

2014-01-23 Thread gboro54
I found that 5 minutes after posting...guess it proves you should read
documentation before posting... Thanks! 


Mark Proctor wrote
 http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/wb.Workbench.html#wb.Installation
 15.1.3. System properties
 
 org.kie.demo: Enables external clone of a demo application from GitHub.
 This System Property takes precedence over org.kie.example. Default: true
 org.kie.example: Enables example structure composed by Repository,
 Organization Unit and Project. Default: false
 Mark
 
 On 23 Jan 2014, at 18:38, gboro54 lt;

 gboro54@

 gt; wrote:
 
 Hi! I am trying to install the Kie-workbench war to a jboss 7 environment
 and
 get the exception below. I would imagine this is because of firewall and
 my
 company will not open a connection to this repo. My question: is there a
 way
 to have the deployment go through without loading the example projects?
 
 Thanks!
 
 Caused by: java.lang.RuntimeException:
 https://github.com/guvnorngtestuser1/guvnorng-playground.git: cannot open
 git-upload-pack
at
 org.uberfire.backend.server.repositories.git.GitRepositoryFactoryHelper.newRepository(GitRepositoryFactoryHelper.java:80)
at
 org.uberfire.backend.server.repositories.git.GitRepositoryFactoryHelper$Proxy$_$$_WeldClientProxy.newRepository(GitRepositoryFactoryHelper$Proxy$_$$_WeldClientProxy.java)
at
 org.uberfire.backend.server.repositories.RepositoryFactoryImpl.newRepository(RepositoryFactoryImpl.java:36)
at
 org.uberfire.backend.server.repositories.RepositoryFactoryImpl$Proxy$_$$_WeldClientProxy.newRepository(RepositoryFactoryImpl$Proxy$_$$_WeldClientProxy.java)
at
 org.uberfire.backend.server.repositories.RepositoryServiceImpl.createRepository(RepositoryServiceImpl.java:182)
at
 org.uberfire.backend.server.repositories.RepositoryServiceImpl.createRepository(RepositoryServiceImpl.java:173)
at
 org.uberfire.backend.server.repositories.RepositoryServiceImpl$Proxy$_$$_WeldClientProxy.createRepository(RepositoryServiceImpl$Proxy$_$$_WeldClientProxy.java)
at
 org.kie.workbench.drools.backend.server.AppSetup.createRepository(AppSetup.java:274)
at
 org.kie.workbench.drools.backend.server.AppSetup.assertPlayground(AppSetup.java:101)
... 43 more
 
 
 
 
 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Kie-Workbench-install-error-tp4027840.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/Kie-Workbench-install-error-tp4027840p4027842.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] Kie-Workbench install error

2014-01-23 Thread Michael Anstis
There's also org.kie.example.repositories that can point to a local folder
containing the example repositories.

The workbench distribution on the drools download page contains a zip
holding the example repositories that are at github (for those unable to
access github).

Sent on the move
On 23 Jan 2014 19:58, gboro54 gbor...@gmail.com wrote:

 I found that 5 minutes after posting...guess it proves you should read
 documentation before posting... Thanks!


 Mark Proctor wrote
 
 http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/wb.Workbench.html#wb.Installation
  15.1.3. System properties
 
  org.kie.demo: Enables external clone of a demo application from GitHub.
  This System Property takes precedence over org.kie.example. Default: true
  org.kie.example: Enables example structure composed by Repository,
  Organization Unit and Project. Default: false
  Mark
 
  On 23 Jan 2014, at 18:38, gboro54 lt;

  gboro54@

  gt; wrote:
 
  Hi! I am trying to install the Kie-workbench war to a jboss 7
 environment
  and
  get the exception below. I would imagine this is because of firewall and
  my
  company will not open a connection to this repo. My question: is there a
  way
  to have the deployment go through without loading the example projects?
 
  Thanks!
 
  Caused by: java.lang.RuntimeException:
  https://github.com/guvnorngtestuser1/guvnorng-playground.git: cannot
 open
  git-upload-pack
 at
 
 org.uberfire.backend.server.repositories.git.GitRepositoryFactoryHelper.newRepository(GitRepositoryFactoryHelper.java:80)
 at
 
 org.uberfire.backend.server.repositories.git.GitRepositoryFactoryHelper$Proxy$_$$_WeldClientProxy.newRepository(GitRepositoryFactoryHelper$Proxy$_$$_WeldClientProxy.java)
 at
 
 org.uberfire.backend.server.repositories.RepositoryFactoryImpl.newRepository(RepositoryFactoryImpl.java:36)
 at
 
 org.uberfire.backend.server.repositories.RepositoryFactoryImpl$Proxy$_$$_WeldClientProxy.newRepository(RepositoryFactoryImpl$Proxy$_$$_WeldClientProxy.java)
 at
 
 org.uberfire.backend.server.repositories.RepositoryServiceImpl.createRepository(RepositoryServiceImpl.java:182)
 at
 
 org.uberfire.backend.server.repositories.RepositoryServiceImpl.createRepository(RepositoryServiceImpl.java:173)
 at
 
 org.uberfire.backend.server.repositories.RepositoryServiceImpl$Proxy$_$$_WeldClientProxy.createRepository(RepositoryServiceImpl$Proxy$_$$_WeldClientProxy.java)
 at
 
 org.kie.workbench.drools.backend.server.AppSetup.createRepository(AppSetup.java:274)
 at
 
 org.kie.workbench.drools.backend.server.AppSetup.assertPlayground(AppSetup.java:101)
 ... 43 more
 
 
 
 
  --
  View this message in context:
 
 http://drools.46999.n3.nabble.com/Kie-Workbench-install-error-tp4027840.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/Kie-Workbench-install-error-tp4027840p4027842.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] kContainer.newKieSession() fails in Apache Karaf

2014-01-23 Thread Charles Moulliard
Hi Joseph,

My example uses this META-INF/kmodules.xml to create the KieBase


On Thu, Jan 23, 2014 at 6:01 PM, jhusby husby...@umn.edu wrote:

 I actually looked through your example project yesterday; very helpful!!!
 However, there are a few things I'm not sure are compatible with what I'm
 trying to do.

 1.  I need to rebuild the rules on the fly, so I was using examples from
 the IncrementalCompilationTest.java
 
 https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java
 
 to accomplish that task.  However, those tests don't use a classpath
 container... can I still rebuild a KieModule via runtime code when running
 in a classpathContainer?

 2.  Your example code calls .newKieSession() on a kbase object as opposed
 to
 a kContainer object.  Is there a reason why?  If I create a new KieSession
 from a kbase vs. kContainer, will I still be able to rebuild the kjar
 dynamically in the code and keep using the same stateful session?

 3.  It looks like I'll have to wait until Drools 6.1.0 to get the parameter
 to specify a classloader when creating the container?  I see you just added
 that recently.  I've tried using
 Thread.currentThread().setContextClassLoader(...) but can't seem to make
 that work with Drools 6.0.1 in Karaf 2.3.3 because then
 RuleBaseConfiguration sets the classloader and uses it to try resolving
 org.drools.core.conflict.DepthConflictResolver, which it can't do because
 it's no longer using the OSGi classloader.

 Thank you,

 Joseph


 Charles Moulliard-2 wrote
  Hi Joseph,
 
  I propose that you have a look to this example which is currently working
  on Karaf - https://github.com/cmoulliard/droolsjbpm-osgi-examples(simple
  =
  OSGI BundleActivator + KieSession + Drools Rules)
 
  Regards,
 
  Charles





 --
 View this message in context:
 http://drools.46999.n3.nabble.com/kContainer-newKieSession-fails-in-Apache-Karaf-tp4027815p4027838.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




-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] kContainer.newKieSession() fails in Apache Karaf

2014-01-23 Thread Charles Moulliard
Hi Joseph,

1.  I need to rebuild the rules on the fly, so I was using examples from
the IncrementalCompilationTest.java

https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java

to accomplish that task.  However, those tests don't use a classpath
container... can I still rebuild a KieModule via runtime code when running
in a classpathContainer?

 My example uses this META-INF/kmodules.xml file to let the KieContainer
to scan and discover the resources (.drl, pacjkages) when we call

   KieContainer kcont =
ks.newKieClasspathContainer(getClass().getClassLoader());
   KieBase kbase = kcont.getKieBase(sampleKBase);

As you have mentioned in your email, this is a static approach as we
load the resources before to create a KieSession and fire the rules.
To be able to do increment, the approach that you mention is the way
to go. I have also created an example where the KieModule is created
using a programming approach --
*https://github.com/cmoulliard/droolsjbpm-osgi-examples/blob/master/simple-external-resource/src/main/java/org/drools/example/osgi/FetchExternalResourceOsgiActivator.java
https://github.com/cmoulliard/droolsjbpm-osgi-examples/blob/master/simple-external-resource/src/main/java/org/drools/example/osgi/FetchExternalResourceOsgiActivator.java.
That should not be difficult to adapt it to support increment*


2.  Your example code calls .newKieSession() on a kbase object as opposed to
a kContainer object.  Is there a reason why?  If I create a new KieSession
from a kbase vs. kContainer, will I still be able to rebuild the kjar
dynamically in the code and keep using the same stateful session?

I need that Mario Fusco or Marc Proctor confirm what I will say here (or
somebody) else but I suspect that if you create a session on the
KieContainer level and not on the KieBase could allow you to support
increment as this unit test show you (
https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java#L660)
without having to recreate a new session (stateless)

3.  It looks like I'll have to wait until Drools 6.1.0 to get the parameter
to specify a classloader when creating the container?  I see you just added
that recently.  I've tried using
Thread.currentThread().setContextClassLoader(...) but can't seem to make
that work with Drools 6.0.1 in Karaf 2.3.3 because then
RuleBaseConfiguration sets the classloader and uses it to try resolving
org.drools.core.conflict.DepthConflictResolver, which it can't do because
it's no longer using the OSGi classloader.

 I have no ideas if my modifications will be merged with 6.0.x release.
Mario Fusco should be able to provide a response

Regards,



On Thu, Jan 23, 2014 at 6:01 PM, jhusby husby...@umn.edu wrote:

 I actually looked through your example project yesterday; very helpful!!!
 However, there are a few things I'm not sure are compatible with what I'm
 trying to do.

 1.  I need to rebuild the rules on the fly, so I was using examples from
 the IncrementalCompilationTest.java
 
 https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java
 
 to accomplish that task.  However, those tests don't use a classpath
 container... can I still rebuild a KieModule via runtime code when running
 in a classpathContainer?

 2.  Your example code calls .newKieSession() on a kbase object as opposed
 to
 a kContainer object.  Is there a reason why?  If I create a new KieSession
 from a kbase vs. kContainer, will I still be able to rebuild the kjar
 dynamically in the code and keep using the same stateful session?

 3.  It looks like I'll have to wait until Drools 6.1.0 to get the parameter
 to specify a classloader when creating the container?  I see you just added
 that recently.  I've tried using
 Thread.currentThread().setContextClassLoader(...) but can't seem to make
 that work with Drools 6.0.1 in Karaf 2.3.3 because then
 RuleBaseConfiguration sets the classloader and uses it to try resolving
 org.drools.core.conflict.DepthConflictResolver, which it can't do because
 it's no longer using the OSGi classloader.

 Thank you,

 Joseph


 Charles Moulliard-2 wrote
  Hi Joseph,
 
  I propose that you have a look to this example which is currently working
  on Karaf - https://github.com/cmoulliard/droolsjbpm-osgi-examples(simple
  =
  OSGI BundleActivator + KieSession + Drools Rules)
 
  Regards,
 
  Charles





 --
 View this message in context:
 http://drools.46999.n3.nabble.com/kContainer-newKieSession-fails-in-Apache-Karaf-tp4027815p4027838.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




-- 
Charles Moulliard
Apache Committer / 

Re: [rules-users] stuck! Unknown accessor type: org.mvel2.optimizers.impl.refl.collection.ArrayCreator@690c2a7a

2014-01-23 Thread Mario Fusco
brachi wrote
 1. does exist an option to dismiss this error, even if it says to disable
 this mvel constraints optimizations?

It is just an harmless log statement and if you want to silent it you just
have to configure your logback.xml file accordingly (i.e. raising the log
level of org.drools.core.rule.constraint.MvelConstraint to error).


brachi wrote
 2. when and where will it be released? can it be fixed on 5.5 or 5.6?

I still don't know if we will drop a 5.6.1 release, but I don't think so.
Very likely this fix will be available only on 6.x

Mario




--
View this message in context: 
http://drools.46999.n3.nabble.com/stuck-Unknown-accessor-type-org-mvel2-optimizers-impl-refl-collection-ArrayCreator-690c2a7a-tp4020969p4027849.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] kContainer.newKieSession() fails in Apache Karaf

2014-01-23 Thread Charles Moulliard
Joseph,

Concerning the KieSession, here is the response :

What is the difference if I create a session on KieContainer vs KieBase
(Global, Local List ...) ?
there shouldn't be any difference. the possibility of creating a session
from a KieContainer is just a shortcut. under the hood it retrieves the
KieBase in which that KieSession has been defined (or build it if you're
using it for the first time) and then creates the KieSession from there

Regards,




On Fri, Jan 24, 2014 at 8:38 AM, Charles Moulliard ch0...@gmail.com wrote:

 Hi Joseph,

 1.  I need to rebuild the rules on the fly, so I was using examples from
 the IncrementalCompilationTest.java
 
 https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java
 
 to accomplish that task.  However, those tests don't use a classpath
 container... can I still rebuild a KieModule via runtime code when running
 in a classpathContainer?

  My example uses this META-INF/kmodules.xml file to let the
 KieContainer to scan and discover the resources (.drl, pacjkages) when we
 call

KieContainer kcont = 
 ks.newKieClasspathContainer(getClass().getClassLoader());
KieBase kbase = kcont.getKieBase(sampleKBase);

 As you have mentioned in your email, this is a static approach as we load the 
 resources before to create a KieSession and fire the rules.
 To be able to do increment, the approach that you mention is the way to go. I 
 have also created an example where the KieModule is created using a 
 programming approach -- 
 *https://github.com/cmoulliard/droolsjbpm-osgi-examples/blob/master/simple-external-resource/src/main/java/org/drools/example/osgi/FetchExternalResourceOsgiActivator.java
  
 https://github.com/cmoulliard/droolsjbpm-osgi-examples/blob/master/simple-external-resource/src/main/java/org/drools/example/osgi/FetchExternalResourceOsgiActivator.java.
  That should not be difficult to adapt it to support increment*


 2.  Your example code calls .newKieSession() on a kbase object as opposed
 to
 a kContainer object.  Is there a reason why?  If I create a new KieSession
 from a kbase vs. kContainer, will I still be able to rebuild the kjar
 dynamically in the code and keep using the same stateful session?

 I need that Mario Fusco or Marc Proctor confirm what I will say here (or
 somebody) else but I suspect that if you create a session on the
 KieContainer level and not on the KieBase could allow you to support
 increment as this unit test show you (
 https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java#L660)
 without having to recreate a new session (stateless)


 3.  It looks like I'll have to wait until Drools 6.1.0 to get the parameter
 to specify a classloader when creating the container?  I see you just added
 that recently.  I've tried using
 Thread.currentThread().setContextClassLoader(...) but can't seem to make
 that work with Drools 6.0.1 in Karaf 2.3.3 because then
 RuleBaseConfiguration sets the classloader and uses it to try resolving
 org.drools.core.conflict.DepthConflictResolver, which it can't do because
 it's no longer using the OSGi classloader.

  I have no ideas if my modifications will be merged with 6.0.x release.
 Mario Fusco should be able to provide a response

 Regards,



 On Thu, Jan 23, 2014 at 6:01 PM, jhusby husby...@umn.edu wrote:

 I actually looked through your example project yesterday; very helpful!!!
 However, there are a few things I'm not sure are compatible with what I'm
 trying to do.

 1.  I need to rebuild the rules on the fly, so I was using examples from
 the IncrementalCompilationTest.java
 
 https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/test/java/org/drools/compiler/integrationtests/IncrementalCompilationTest.java
 
 to accomplish that task.  However, those tests don't use a classpath
 container... can I still rebuild a KieModule via runtime code when running
 in a classpathContainer?

 2.  Your example code calls .newKieSession() on a kbase object as opposed
 to
 a kContainer object.  Is there a reason why?  If I create a new KieSession
 from a kbase vs. kContainer, will I still be able to rebuild the kjar
 dynamically in the code and keep using the same stateful session?

 3.  It looks like I'll have to wait until Drools 6.1.0 to get the
 parameter
 to specify a classloader when creating the container?  I see you just
 added
 that recently.  I've tried using
 Thread.currentThread().setContextClassLoader(...) but can't seem to make
 that work with Drools 6.0.1 in Karaf 2.3.3 because then
 RuleBaseConfiguration sets the classloader and uses it to try resolving
 org.drools.core.conflict.DepthConflictResolver, which it can't do because
 it's no longer using the OSGi classloader.

 Thank you,

 Joseph


 Charles Moulliard-2 wrote
  Hi Joseph,
 
  I propose that you have a look to this example